Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make one float out of 2 integer

Status
Not open for further replies.

666cartman

Programmer
Aug 27, 2002
20
0
0
DE
i have 2 integersand want to make them to 1 float,
eg: int i,j; i=3; j=234567323;
float f=3.234567323
 
int i,j; i=3; j=234567323;
float f, m;

/* Work out the fractional mantissa */
m = j;
while (m > 1.0)
m *= 0.1;
/* Add the fraction and the ms digit */
f = i + m;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top