[A89] Re: what is wrong with atof()?!


[Prev][Next][Index][Thread]

[A89] Re: what is wrong with atof()?!




> As you say, assuming the rows of the file contain valid floats, it
> should work the same as in the -pi test... is the 'buffer' string
> really valid all the time? Do the numbers follow the TIOS standard,
> i.e. '-' is '(-)' and the TIOS exponent char instead of 'e' or 'E'?

I'm quite sure that they're right, that's why I have the while loop that
prints out the ascii values of each character in buffer.  The ascii
values of the pi test print out just the same as the other numbers, but
the pi test works with atof().  Which is why this is so wierd.  Although
I didn't think about the exponent character, the (-) is accounted for,
and there are no exponents in my numbers.

This is exactly what I have:

text file (this is actually generated by the program, see the
save_parameters() function):
;Cx
0
;Cy
1
;screen center x
1.5
;screen center y
(-)2
;zoom factor
(-)1.5
;max iterations
250

program output:
32 48
 0  0
32 49
 1  0
32 49 36 53
 1.5  0
32 -83 50
 (-)2  0
32 -83 49 36 53
 (-)1.5  0
32 50 53 48
 250  0
32 -83 51 46 49 52 49 53 57 50 54
 (-)3.1415926  -3.1415926


Jon K.
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/web/.