Well, the numbers are a bit silly for doing this sort of thing, but the seg
fault is clearly a bug!
Can you report it please. (bugs.php.net)
Thanks
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org
-----Original Message-----
From: Ben Peter <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>; [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
Date: Friday, February 16, 2001 12:34 PM
Subject: Re: [PHP] How to transfer "2.2864849511949E+190" to a
normal-human-readable number?
>Hi,
>
>have to correct that (thanks to Adam Whitehead for pointing out).
>
>It should be %f instead of %d. However:
>
>'<? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%f\n",
>$foo) ?>' | php -q
>228648495119489900000000000000000000000000000000000000000000000000000000000
0000
>Segmentation fault (core dumped)
>[ben@home ben]$
>
>This is PHP4.0.4pl1
>
>Ben
>
>Ben Peter wrote:
>>
>> Hi,
>>
>> I tried
>>
>> <? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%d\n",
>> $foo) ?>
>>
>> which gave me
>>
>> -2147483648
>>
>> echo $foo gives
>>
>> 2.2864849511949E+190
>>
>> - This looks like the number is too large for printf (the 'human
>> readable form' printed by printf is abviously wrong).
>>
>> Does anybody know such of limits to sprintf?
>>
>> Ben
>>
>> SED wrote:
>> >
>> > Hi,
>> >
>> > I'm multiplying floating numbers:
>> >
>> > $result = $foo * $boo; and the result is like this:
>> >
>> > echo "$result";
>> >
>> > And the result is like this:
>> >
>> > 2.2864849511949E+190
>> >
>> > How can I transfer this to normal-human-readable number?
>> >
>> > Regards,
>> > Sumarlidi Einar Dadason
>> >
>> > SED - Graphic Design
>> >
>> > ------------------------------------------
>> > Phone: (+354) 4615501
>> > Mobile: (+354) 8960376
>> > Fax: (+354) 4615503
>> > E-mail: [EMAIL PROTECTED]
>> > Homepage: www.sed.is <- New Homepage!
>> > ------------------------------------------
>> >
>> > --
>> > 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]
>>
>> --
>> 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]
>
>--
>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]
>
>
--
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]