Problem with HUGE floating values and fmod

From: Date: Fri, 17 Feb 2006 18:48:13 +0000
Subject: Problem with HUGE floating values and fmod
Groups: php.general 
Request: Send a blank email to php-general+get-230659@lists.php.net to get a copy of this message
Hi there, I'm trying to calculate check digits for a payment system, using the ISO 7064 (MOD 97-10) algorithm, wich is, already translated to PHP: $check=98-fmod(($num*100),97); Where $num is a huge number... Example: 90150123123400043211 should have check digit 51 In windows calculator: 98 - ( (90150123123400043211 * 100) mod 97) works OK and I get 51 as result In PHP I get 13... Any problems with the number beeing this huge? Notice that I tried to "echo number_format(90150123123400043211+1);", in order to test some math on this number, and got "90,150,123,123,400,040,000" wich is strange... If possible, please reply to marcoalmeida@webdados.pt Thanks in advance. Marco Almeida Project Manager WEBDADOS Tecnologias de Informação Telef.: +351 21 466 93 00 Fax: +351 21 466 42 81 Móvel: +351 96 324 43 44 Email: marcoalmeida@webdados.pt www: http://www.webdados.pt Morada: R. 9 de Abril, 3-3A, Sala 4 2765-545 S. Pedro do Estoril

« previous php.general (#230659) next »