3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php ini_set('precision', 100); echo round('0.48499999999999', 2) . "\n"; echo round('0.484999999999999', 2) . "\n"; echo round('10.4849999999999', 2) . "\n"; echo round('10.48499999999999', 2) . "\n"; echo round('100.484999999999', 2) . "\n"; echo round('100.4849999999999', 2) . "\n"; echo round('1000.48499999999', 2) . "\n"; echo round('1000.484999999999', 2) . "\n"; echo round('10000.4849999999', 2) . "\n"; echo round('10000.48499999999', 2) . "\n"; echo round('100000.484999999', 2) . "\n"; echo round('100000.4849999999', 2) . "\n"; echo round('1000000.48499999', 2) . "\n"; echo round('1000000.484999999', 2) . "\n"; echo round('10000000.4849999', 2) . "\n"; echo round('10000000.48499999', 2) . "\n"; echo round('100000000.484999', 2) . "\n"; echo round('100000000.4849999', 2) . "\n"; echo round('1000000000.48499', 2) . "\n"; echo round('1000000000.484999', 2) . "\n"; echo round('10000000000.4849', 2) . "\n"; echo round('10000000000.48499', 2) . "\n";
Output for 5.3.0 - 5.3.3, 5.3.7 - 5.6.28, 7.0.0 - 7.1.0
0.479999999999999982236431605997495353221893310546875 0.479999999999999982236431605997495353221893310546875 10.480000000000000426325641456060111522674560546875 10.4900000000000002131628207280300557613372802734375 100.4800000000000039790393202565610408782958984375 100.4899999999999948840923025272786617279052734375 1000.48000000000001818989403545856475830078125 1000.490000000000009094947017729282379150390625 10000.47999999999956344254314899444580078125 10000.489999999999781721271574497222900390625 100000.479999999995925463736057281494140625 100000.490000000005238689482212066650390625 1000000.4799999999813735485076904296875 1000000.48999999999068677425384521484375 10000000.4800000004470348358154296875 10000000.49000000022351741790771484375 100000000.48000000417232513427734375 100000000.48999999463558197021484375 1000000000.480000019073486328125 1000000000.4900000095367431640625 10000000000.479999542236328125 10000000000.4899997711181640625
Output for hhvm-3.10.0 - 3.12.0
0.48 0.48 10.48 10.49 100.48 100.49 1000.48 1000.49 10000.48 10000.49 100000.48 100000.49 1000000.48 1000000.49 10000000.48 10000000.49 100000000.48 100000000.49 1000000000.48 1000000000.49 10000000000.48 10000000000.49
Output for 5.3.4 - 5.3.6
0.479999999999999982236431605997495353221893310546875 0.4899999999999999911182158029987476766109466552734375 10.480000000000000426325641456060111522674560546875 10.4900000000000002131628207280300557613372802734375 100.4800000000000039790393202565610408782958984375 100.4899999999999948840923025272786617279052734375 1000.48000000000001818989403545856475830078125 1000.490000000000009094947017729282379150390625 10000.47999999999956344254314899444580078125 10000.489999999999781721271574497222900390625 100000.479999999995925463736057281494140625 100000.490000000005238689482212066650390625 1000000.4799999999813735485076904296875 1000000.48999999999068677425384521484375 10000000.4800000004470348358154296875 10000000.49000000022351741790771484375 100000000.48000000417232513427734375 100000000.48999999463558197021484375 1000000000.480000019073486328125 1000000000.4900000095367431640625 10000000000.479999542236328125 10000000000.4899997711181640625
Output for 5.2.7 - 5.2.17
0.4899999999999999911182158029987476766109466552734375 0.4899999999999999911182158029987476766109466552734375 10.480000000000000426325641456060111522674560546875 10.4900000000000002131628207280300557613372802734375 100.4800000000000039790393202565610408782958984375 100.4800000000000039790393202565610408782958984375 1000.48000000000001818989403545856475830078125 1000.48000000000001818989403545856475830078125 10000.47999999999956344254314899444580078125 10000.47999999999956344254314899444580078125 100000.479999999995925463736057281494140625 100000.479999999995925463736057281494140625 1000000.4799999999813735485076904296875 1000000.4799999999813735485076904296875 10000000.4800000004470348358154296875 10000000.4800000004470348358154296875 100000000.48000000417232513427734375 100000000.48000000417232513427734375 1000000000.480000019073486328125 1000000000.480000019073486328125 10000000000.479999542236328125 10000000000.479999542236328125
Output for 4.3.0 - 5.2.6
0.479999999999999982236431605997495353221893310546875 0.479999999999999982236431605997495353221893310546875 10.480000000000000426325641456060111522674560546875 10.480000000000000426325641456060111522674560546875 100.4800000000000039790393202565610408782958984375 100.4800000000000039790393202565610408782958984375 1000.48000000000001818989403545856475830078125 1000.48000000000001818989403545856475830078125 10000.47999999999956344254314899444580078125 10000.47999999999956344254314899444580078125 100000.479999999995925463736057281494140625 100000.479999999995925463736057281494140625 1000000.4799999999813735485076904296875 1000000.4799999999813735485076904296875 10000000.4800000004470348358154296875 10000000.4800000004470348358154296875 100000000.48000000417232513427734375 100000000.48000000417232513427734375 1000000000.480000019073486328125 1000000000.480000019073486328125 10000000000.479999542236328125 10000000000.479999542236328125