From: ptrouton@bfsec.bt.co.uk (Paul Trouton) Subject: C, doubles Date: Mon, 20 Sep 1993 09:53:57 GMT
I hope this is the right group....
I am writing a program which is basically a commandline interface, talking in commands and producing a result. All parts of the commands are read in as character. However
once in the computer, some may need to be converted to a double or integer.
e.g. (set vat = 17.5)
set, vat, =, and 17.5 are all read in as a character name. Then "17.5" is converted to a double by the command 'double = strtod(spelling)'
My problem is that I can compile the program, but once I try and run the program, it gives me a 'floating point exception error' after the command to change vat (or any other string to double conversion).
The program works fine on the Sun, but not on my 486 at home, under Linux.
How using the gcc compiler can I enable my program to work.
Thanks in advance for any help.
Paul.
P.s. thanks to everyone who helped me earlier.
Paz....