scorpio2002
November 1st, 2005, 07:44 AM
Hi there! I'm new to programming and I'm studying C on the famous book by Kernighan and Ritchie. I was stuck at chapter 4 where the authors described an algorithm for evaluating a reverse polish string.
The problem was that on my pc the algorithm returned a topsy-turby result instead of the right one. I've then found out what the problem was.
At first, like suggested by the book, I used the implementation of the function atof in <math.h>. Then, after some days of searching, I tried to use another implementation of atof belonging to <stdlib.h> and the algorithm worked fine.
Now comes my question: why are there two different implementations of atof? and why does the one in math.h do anything but what's supposed to do?
thx,
Donato :-)
The problem was that on my pc the algorithm returned a topsy-turby result instead of the right one. I've then found out what the problem was.
At first, like suggested by the book, I used the implementation of the function atof in <math.h>. Then, after some days of searching, I tried to use another implementation of atof belonging to <stdlib.h> and the algorithm worked fine.
Now comes my question: why are there two different implementations of atof? and why does the one in math.h do anything but what's supposed to do?
thx,
Donato :-)