[wp-trac] [WordPress Trac] #65271: REST API Integer Type Check Fails on Large Ints

WordPress Trac noreply at wordpress.org
Tue May 19 14:48:05 UTC 2026


#65271: REST API Integer Type Check Fails on Large Ints
--------------------------+------------------------------
 Reporter:  kevinfodness  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  REST API      |     Version:  trunk
 Severity:  minor         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by kevinfodness):

 Here is an example of the bug:

 `> var_dump( round( (float) 9004111231758204 ) );`
 `float(9004111231758205)`

 I would expect the last digit to ''not'' change, but it does, because of
 the lack of precision in floats of this length (16 digits) combined with
 the behavior of `round`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65271#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list