On Friday 16 February 2001 12:33, Ben Peter wrote:

> It should be %f instead of %d. However:
>
> '<? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%f\n",
> $foo) ?>' | php -q
> 22864849511948990000000000000000000000000000000000000000000000000000000
>00000000 Segmentation fault (core dumped)

Well, I *can* understand that printf () isn't prepared to handle numbers 
with 190 digits :)

> > >         2.2864849511949E+190
> > >
> > > How can I transfer this to normal-human-readable number?

Well, I doubt that 

2286484951194899000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

is more human-readable than

2.2864849511949E+190

Perhaps you want to change it to
2.2864849511949 * 10^190

But I'd say adding a note explaining the "E" notation is simpler...

PS: The long number is, scientifically seen, also *less* correct than the 
'E' form - the 'E' form states that it is a number with a precision of 16 
digits, while the long one implies that it has a precision of 190 digits 
(which is definitely wrong).

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"World domination. Fast." (Linus Torvalds about Linux)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to