Bug #71877 [NEW]: results not as expected

From: Date: Tue, 22 Mar 2016 09:36:35 +0000
Subject: Bug #71877 [NEW]: results not as expected
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200025@lists.php.net to get a copy of this message
From:             iskandarm at live dot com
Operating system: linux
PHP version:      5.5.33
Package:          *Math Functions
Bug Type:         Bug
Bug description:results not as expected

Description:
------------
---
From manual page: http://www.php.net/function.ceil
---

i am trying to use ceil function , but for some numbers , i got
unexpected results 

please find example in the test script .

Test script:
---------------
<?php
$dNumber = 1.1;
$dExponential = 100;
$x = ($dExponential*$dNumber);
var_dump($x);
var_dump(ceil($x));

Expected result:
----------------
expected results of the ceil is 110

Actual result:
--------------
111

-- 
Edit bug report at https://bugs.php.net/bug.php?id=71877&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71877&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71877&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71877&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71877&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71877&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71877&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71877&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71877&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71877&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71877&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71877&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71877&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71877&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71877&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71877&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71877&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71877&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71877&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71877&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71877&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#200025) next »