[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
strtold() function doesn't convert properly.
From: |
Skip |
Subject: |
strtold() function doesn't convert properly. |
Date: |
Thu, 18 Nov 2004 12:45:07 -0800 (PST) |
Strtold() doesn't work properly. Here is a test
program and its output.
Compile with: gcc progname && a.out
//-------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
int main ( int argc, char *argv[] )
{
char s[] = "1234567.987654";
long double ld=0;
char *endptr=NULL;
ld = strtold( s, &endptr );
printf("s = '%s' ld = %Lf\n", s, ld);
printf("s = '%p' endptr = %p\n", s, endptr);
return 0;
}
//-------------------------------------------------------------------------
// Here is the output.
// s = '1234567.987654' ld = -1766572058.000000
// s = '0xbffff930' endptr = 0xbffff93e
//-------------------------------------------------------------------------
__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com
- strtold() function doesn't convert properly.,
Skip <=