Skip to content

Incorrect float behavior with large numbers #22410

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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions