php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26643 numeric converted to float
Submitted: 2003-12-17 03:27 UTC Modified: 2003-12-17 04:21 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: michael dot frank at bmg dot com Assigned:
Status: Not a bug Package: Sybase-ct (ctlib) related
PHP Version: 4.3.4 OS: RedHat Linux
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: michael dot frank at bmg dot com
New email:
PHP Version: OS:

 

 [2003-12-17 03:27 UTC] michael dot frank at bmg dot com
Description:
------------
When I try to fetch a numeric (18,0) value in php 4.2.3 I get correct values. After upgrade to php 4.3.4 I get  converted numbers.

On the older Version i Recieved e.g.:

1150000000002401

on the new version i get this:

1.1500000000024E+15

It seems like a old php bug - but i have the newest PHP Version running 
Sybase is ASE 12.5 on RedhatLinux. Apache is 1.3.29



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-17 04:21 UTC] helly@php.net
Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.
 
Thank you for your interest in PHP.

The two numbers 1150000000002401 and 1.1500000000024E+15 are the exact same number on your machine.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 05:01:28 2024 UTC