Modulus and floating point...

From: Date: Fri, 04 Jan 2002 19:10:54 +0000
Subject: Modulus and floating point...
Groups: php.general 
Request: Send a blank email to php-general+get-79484@lists.php.net to get a copy of this message
Consider the following: $number = 102.52; echo $number % 50; echo bcmod( $number, 50 ); in both cases, it's spitting out "2". Why is it not spitting out "2.52"? Is there a way I can get that information? w/o having to parse the string, breaking it up, getting the modulus and then adding it back into the end result...? Chris

« previous php.general (#79484) next »