Hi!

> On x86_64 (so, with or without -O2)
> 
> 
> $ gcc -O2 -Wall math2.c -o math2 && ./math2 9223372036854775807
>   double=9223372036854775808
>   signed=8000000000000000
> unsigned=8000000000000000
> 
> 
> On ppc64
> 
> $ gcc -O2 -Wall math2.c -o math2 && ./math2 9223372036854775807
>   double=9223372036854775808
>   signed=0x7fffffffffffff
> unsigned=8000000000000000

So, looks like on ppc64 double->long conversion works differently than
on x86_64. Maybe best solution would be to make the patch with ifdef for
ppc64 so that it would do the same as Intel... Though I'm not sure if
somebody on this platform would expect PHP behave as C does, or as Intel
counterpart does. I'd say I  personally probably would prefer
Intel-compatible behavior since most software would be expected to be
tested on Intel. But formally I'm not sure it's even wrong behavior...
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to