(int)(314.96*1000)/10 => 31496
(int)(314.96*100) => 31495

#php <3

The Floating-Point Guide - What Every Programmer Should Know About Floating-Point Arithmetic

Aims to provide both short and simple answers to the common recurring questions of novice programmers about floating-point numbers not 'adding up' correctly, and more in-depth information about how IEEE 754 floats work, when and how to use them correctly, and what to use instead when they are not appropriate.