public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* atof()
@ 2002-08-19 10:49 Reinaldo Nolasco Sanches
  2002-08-19 11:03 ` atof() H. J. Lu
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Reinaldo Nolasco Sanches @ 2002-08-19 10:49 UTC (permalink / raw)
  To: gcc

I have a problem with atof()... and I don't understand because it...
When I use atof() to get a value of a string... and put in my double var, the value is not the
same...

I make a little example...

#include <stdio.h>

int main()
{
	double teste;
	char   strteste[10];
	
	strcpy( strteste, "120.1" );
	
	teste = atof( strteste );
	
	printf( "\n\tResult is = %.2f\n\n", teste );
	
	return 0;
}

and the result is this

    Result is = 1078984704.00

and I don't understand this... I make this in several PCs... and in a SuSE, in a Slackware and in
a RedHat(urgg!), and in all the erro ocurred...

I don't know if I need set a specific #define... or a specific environment var...

Please... anybody can help me ???

I compiled with...
   gcc -i teste.c -o teste


Thanks a lot in advance...




=====
"When you know Slackware, you know Linux... when you know Red Hat, all you know is Red hat"

- Anyone seen smoking will be assumed to be on fire and will be summarily put out.
- Power doesn't corrupt people, people corrupt power.

- r_linux@yahoo.com -- http://slackware.linuxbr.org
- UIN: 42853394 - irc.brasnet.org(#slackware)

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <Pine.LNX.4.33L2.0208191404020.11506-100000@sol.galaxy.acm.jhu.edu>]

end of thread, other threads:[~2002-08-19 12:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-19 10:49 atof() Reinaldo Nolasco Sanches
2002-08-19 11:03 ` atof() H. J. Lu
2002-08-19 11:09 ` atof() Janis Johnson
2002-08-19 11:13 ` atof() Andreas Jaeger
2002-08-19 11:13 ` atof() Brad House
2002-08-19 11:18 ` atof() Erik Trulsson
     [not found] <Pine.LNX.4.33L2.0208191404020.11506-100000@sol.galaxy.acm.jhu.edu>
2002-08-19 12:57 ` atof() Reinaldo Nolasco Sanches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).