Top Ad unit 728 × 90

ticker

Doubles in PHP

Doubles

They like 3.14159 or 49.1. By default, doubles print with the minimum number of decimal places needed. For example, the code:


$many = 2.2888800;
$many_2 = 2.2111200;
$few = $many + $many_2;
print(.$many + $many_2 = $few
.);

It produces the following browser output:

2.28888 + 2.21112 = 4.5
Doubles in PHP Reviewed by Rajat Jha on 19:48:00 Rating: 5

No comments:

All Rights Reserved by INFO PHP 99 © 2014 - 2015
Powered by Blogger, Designed by Sweetheme

Contact Form

Name

Email *

Message *

Powered by Blogger.