Visitar URL original
Incorrect float behavior with large numbers · Issue #22410 · php/php-src · GitHub
Skip to content

Incorrect float behavior with large numbers #22410

Closed

Description

@WanSpi

Description

Only in versions 8.4.x & 8.5.x, on 8.3.x everything works correctly.
Bug appears only with large numbers.

The following code:

<?php
var_dump(
  round( (float) 9003241321073828 )
);

Resulted in this output:

float(9003241321073829)

But I expected this output instead:

float(9003241321073828)

PHP Version

8.4.x & 8.5.x

Operating System

Activity

  1. added a commit that references this issue on Jun 24, 2026
    637687a
  2. added a commit that references this issue on Sep 5, 2026
    c54c15c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions