Re: Re: different behavior converting float to integer
| From: | Joe Orton | Date: | Wed, 06 Oct 2004 13:18:05 +0000 |
| Subject: | Re: Re: different behavior converting float to integer | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13201@lists.php.net to get a copy of this message | ||
On Wed, Oct 06, 2004 at 08:56:15AM -0400, Noah Botimer wrote:
> Joe,
>
> This may be crazy, but does it make sense to think of integers in a more
> defined manner? That is, ``integer'' being equivalent to a long, which
> does have a guarantee on size (32-bit)? Also, some kind of long long
> type for 64-bit support would have to be included. I mean, consistency
> is something I value... Does it make sense to just be pragmatic and
> switch over to defined/guaranteed sizes/behavior, rather than hoping and
> bailing out under the ``platform-defined'' clause? Is this at all
> applicable?
Storing large integers in a long long rather than a double would be a
big change to Zend, I expect, and it really doesn't avoid the issue that
you still have to decide on a behaviour when a large integer is cast
down to a long. Converting a long long > LONG_MAX to a long is still
not defined behaviour in C99 (it's an "implementation-defined behaviour
or an implementation-defined signal" case)
joe