Problem with Turbo C and floating point

Brian R. Bainter brb at akgua.ATT.COM
Mon Aug 15 23:19:33 AEST 1988


I hope someone can tell me what I am doing wrong or at least
(heaven forbid) what the compiler is doing strange.

I have an application where I have a data entry field. The field
is labeled as a floating point field, however it is entered into
a string variable. No problem yet. When I load this "floating point"
string into a float with a sscanf, I do have a sort of problem.
If the number in the string is for example 9999999.99 it ends up in
the float as 10000000.00000 and a number entered as 1111111.11 ends
up in the float as 1111111.12500.

If anyone could enlighten my mind as to what I am doing wrong, or
what the compiler is doing wrong and possibly give me a work around,
I would be most greatful.

BTW: my compiler is Turbo C 1.5.

Thanks in advance for any help

-- 
	Brian R. Bainter   KA7TXA

 AT&T Technologies Atlanta Works
 {cbosgd, gatech, ihnp4, moss, mtune, ulysses}akgua!brb



More information about the Comp.lang.c mailing list