Complete.Org: Mailing Lists: Archives: discussion: March 2000:
[aclug-L] C problem redux....
Home

[aclug-L] C problem redux....

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ACLUG <discussion@xxxxxxxxx>
Subject: [aclug-L] C problem redux....
From: Larry Bottorff <mrprenzl@xxxxxxxxxx>
Date: Sun, 05 Mar 2000 12:13:50 -0600
Reply-to: discussion@xxxxxxxxx

Here's some code that's confusing me:

#include <stdlib.h>

int main()
{
  char number[] = {"5.333009"};
  double dval;
  dval = atof("5.333009");
  printf("number: %s\n", number);
  printf("number: %lf\n", dval);
  

}

Here's the output:

number: 5.333009
number: 349440.000000

Where on earth is it getting 349440.000000 ? I get the same results when
I try atof(number). Sunday is an odd day, right?

Larry Bottorff

-- This is the discussion@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]