php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21266 ceil() misbehaviour
Submitted: 2002-12-29 09:35 UTC Modified: 2002-12-29 09:36 UTC
From: flying at dom dot natm dot ru Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.3 OS: All
Private report: No CVE-ID: None
 [2002-12-29 09:35 UTC] flying at dom dot natm dot ru
Please take a look at following example:
<?php
echo ceil(83.47 * 100 * 31);
echo ceil(83.47 * 31 * 100);
?>

 For both for PHP 4.2.3 and 4.3.0 RC2, it gives me this result:
258757
258758

 which is definitly breaks mathematical rules. Correct result should be 258757.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-29 09:36 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Read up on the floating point type in the manual.

Derick
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 06 14:00:01 2025 UTC