php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17787 integer/double problem
Submitted: 2002-06-16 11:49 UTC Modified: 2002-06-16 14:16 UTC
From: j dot neubert at 21torr dot com Assigned:
Status: Not a bug Package: Math related
PHP Version: 4.1.2 OS: Windows NT 5.0 build 2195
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: j dot neubert at 21torr dot com
New email:
PHP Version: OS:

 

 [2002-06-16 11:49 UTC] j dot neubert at 21torr dot com
$f = 2.26;
$g = $f*100;
echo(intval($g)."::".$g."<br>");
//output = 225::226

$f = 2.26;
$g = $f*1000/10;
echo(intval($g)."::".$g."<br>");
//output = 226::226

could anybody explain this to me

i also tested on Linux / php version 4.0.6
as far as i know 2.26 is the only double value
creating this bug...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-16 14:16 UTC] derick@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.

See also: http://www.php.net/manual/en/language.types.float.php#language.types.float
 [2002-06-16 14:57 UTC] j dot neubert at 21torr dot com
Derick,

the explanation on

http://www.php.net/manual/en/language.types.float.php#language.types.float

seems to be pretty lame excuse for not being able or willing to check for a c-math-lib on the corrosponding system to be able to do such simple mathematic equations transparent to the user...

you have to admit that this could be very well regarded as a bug or a not very well documented feature... true, binary equations are a hastle to do, but with all of the things php does for you, this shouldn't be to much of a hastle for the php-developers... 

In the end it _IS_ an expected behaviour that 2.26 multiplied with 100 equals to 226, binary equation or not, statet in an obscure place in the documentation or not...

anyhow, have a nice day too and thanks for your quick reply.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Nov 18 23:01:35 2019 UTC