atof() in SCO UNIX DEV

atof() in SCO UNIX DEV

Post by Tillmann Basi » Wed, 10 Oct 1990 22:37:30



Hy netlanders,
        I have SCO UNIX Version 3.2.0 with Development Kit.
        The atof()-function does not work proberly. Is there a work-a-round
        of this problem?

        My test-programm:

                #include <stdio.h>
                #include <math.h>

                main()
                {
                 double f;
                 f=atof("123.23");
                 printf("F: %f \n",f);
                }
--
Dipl.Ing. Tillmann Basien                Programmentwicklung fuer Microcomputer
Vaihinger Str.49, PostBox 810165                      +49-711-713047    FAX
7000 Stuttgart 80- West Germany                       +49-711-713045    PHONE

 
 
 

atof() in SCO UNIX DEV

Post by Doug Gw » Fri, 12 Oct 1990 22:43:55



>    The atof()-function does not work proberly.

I suspect that it works just fine.  Your sample program had a serious BUG.
(Hint: where was atof() declared?)

 
 
 

atof() in SCO UNIX DEV

Post by Marc Unang » Sat, 13 Oct 1990 17:49:03



> (Hint: where was atof() declared?)

In /usr/include/math.h.  Didn't you see the '#include <math.h>' line?

--
Marc Unangst               |

...!umich!leebai!mudos!mju |

 
 
 

atof() in SCO UNIX DEV

Post by Richard Tob » Sat, 13 Oct 1990 21:45:42



>       The atof()-function does not work proberly. Is there a work-a-round
>       of this problem?

Unfortunately you don't say in what way it doesn't work.  One possibility
is that it is not declared in the .h files you include - try adding

   extern double atof();

to your program.

-- Richard
--


Edinburgh University.                UUCP:  ...!ukc!ed.ac.uk!R.Tobin

 
 
 

atof() in SCO UNIX DEV

Post by =Ronald van der P » Sun, 14 Oct 1990 09:46:16


| Hy netlanders,
|       I have SCO UNIX Version 3.2.0 with Development Kit.
|       The atof()-function does not work proberly. Is there a work-a-round
|       of this problem?
                atof() **does** work normally

|       My test-programm:

|               #include <stdio.h>
|               #include <math.h>
                        #include <stdlib.h>

|               main()
|               {
|                double f;
|                f=atof("123.23");
|                printf("F: %f \n",f);
|               }
        SCO UNIX has an ANSI C compiler. ANSI C's atof() is decared
        in "stdlib.h".

--

 
 
 

atof() in SCO UNIX DEV

Post by Doug Gw » Sun, 14 Oct 1990 02:07:38




>> (Hint: where was atof() declared?)
>In /usr/include/math.h.  Didn't you see the '#include <math.h>' line?

I certainly DID see that line.  I repeat the question.
 
 
 

atof() in SCO UNIX DEV

Post by Jack Cloning » Tue, 16 Oct 1990 01:49:12




>|   I have SCO UNIX Version 3.2.0 with Development Kit.
>|   The atof()-function does not work proberly. Is there a work-a-round
>|   of this problem?
>|
>    SCO UNIX has an ANSI C compiler. ANSI C's atof() is decared
>    in "stdlib.h".

IMHO the problem here is documentation.  The SCU Unix System V/386
Development System Programmer's Reference manual manual page for ATOF(S)
gives the following syntax description:

     #include <math.h>
     double atof(nptr)
     char *nptr;

The entry for "atoi" and "atol" give the correct include file, which
is as Mr. van der Pol states, "stdlib.h."  Mr. Basien did everything
correctly according to the manual, but was simply bitten by a
documentation error.
--
Jack Cloninger, TeqSoft, 112 US Highway 1, Tequesta, FL 33469    B-)
...uunet!comtst!teqsoft!jmc   Phone: 407-747-7163  Fax: 407-747-0354

 
 
 

atof() in SCO UNIX DEV

Post by George Turczyns » Thu, 18 Oct 1990 09:22:21





> >> (Hint: where was atof() declared?)
> >In /usr/include/math.h.  Didn't you see the '#include <math.h>' line?

> I certainly DID see that line.  I repeat the question.

Try <floatingpoint.h>, included in <math.h> (SunOS 4.0.3).

--
George P. J. Turczynski,   Computer Systems Engineer. Highland Logic Pty Ltd.

Phone:  +61 48 683490      |  Witty remarks are as  | Moss Vale, NSW. 2577
Fax:    +61 48 683474      |  hard to come by as is | Australia.
---------------------------   space to put them !    ---------------------------

 
 
 

atof() in SCO UNIX DEV

Post by Doug Gw » Sat, 20 Oct 1990 02:19:53



>Try <floatingpoint.h>, included in <math.h> (SunOS 4.0.3).

What does that have to do with the price of * in Ethiopia?