Floating Point Formates

Scott Turner srt at maui.cs.ucla.edu
Thu Mar 1 12:01:08 AEST 1990


In article <1990Feb28.210122.24511 at xenitec.on.ca> timk at xenitec.UUCP (Tim Kuehn) writes:
>I'm working on a program and am having a problem with the atof() function.
>Every time I run it with a certain option  turned on I get an error: 
>scanf : floating point formats not linked.

In the future, you should say what compiler you're using, what
machine, etc.  Fortunately this problem is so common that it isn't
necessary.

The problem is that TurboC doesn't link in the floating point lib
unless it thinks it is needed.  And basically TurboC thinks it will be
needed if it sees a floating point function being used.  So to force
TurboC to link in the floating point library, put the pointless line:

	(void) exp(1.0);

somewhere in your code.  That should do it.
 
    Scott R. Turner
    UCLA Computer Science     "It's so bad it's not even wrong"
    Domain: srt at cs.ucla.edu
    UUCP:  ...!{cepu,ihnp4,trwspp,ucbvax}!ucla-cs!srt



More information about the Comp.lang.c mailing list