Hi.
I divide to numerics and get 33.670033670034
Then I do a ceil() and get 34
But when I try to convert/cast (float) 34 to (int) 34 I get no result...
Is there some hidden overflow or something I'm missing?
Why can't I cast this float to int?
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
this sure seems to workoutputs
Code: Select all
<?php
$foo = 33.670033670034;
var_dump($foo);
echo "\n";
var_dump(ceil($foo));
echo "\n";
var_dump((int)ceil($foo));
?>Code: Select all
float(33.670033670034)
float(34)
int(34)