zhoppy Posted November 30, 2007 Share Posted November 30, 2007 Hey guys, I'm having trouble with float(1) converting to int(0) Quick sample code below. Anyone have any ideas? Thanks! -Zac $a = 7.1; $i = (($a-7) * 10); //var_dump($i); var_dump((int)$i); $a = 7.1: Output: int(0) Expected: int(1) $a = 7.2: Output: int(2) Expected: int(2) Link to comment https://forums.phpfreaks.com/topic/79494-strange-float-to-int-conversion-with-1/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.