Re: Re: Bug #1335 Updated: modulus operator overflows

From: Date: Tue, 20 Apr 1999 23:00:30 +0000
Subject: Re: Re: Bug #1335 Updated: modulus operator overflows
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-5162@lists.php.net to get a copy of this message
On Tue, 20 Apr 1999, Cam Clarke wrote: > It's your party and all, but the fact that: > $a % $b > returns a constant for all $a > (2^31) - 1 seems to me > like a bug no matter how you look at it. You could > throw an error, promote to double, document it as intended, > or if you're busy leave the bug open, but closing the bug and > leaving it as-is seems a disservice to the fine work you all have done. > > Just my opinion, Actually it makes a lot of sense. You cannot promote to a double since the modulus operator is undefined on floating point numbers, only integers. Documenting it as intended is reasonable, and if somebody has time to patch in optional BC support to automatically convert that number to a string and use arbitrary precision math routines on it, it's good too. Zeev -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#5162) next »