PHP calculate as 110400 but it inserts 110399 into MySQL
I have a model TestFloat with the schema as below.
CREATE TABLE tbl_test_float (
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`amount` int(11) DEFAULT NULL
);
As I run the code below
$testFloat = new TestFloat();
$testFloat->amount = 36.8 * 3000;
echo "TestFloat 1: {$testFloat->amount}<br />";
$testFloat->save();
$testFloat = new TestFloat();
$testFloat->amount = 110400;
echo "TestFloat 2: {$testFloat->amount}<br />";
$testFloat->save();
it displays
TestFloat 1: 110400
TestFloat 2: 110400
but it insert different values of "amount" into MySQl (110399 vs 110400).
The sql log is as below
2014/06/05 01:32:28 [trace] [system.db.CDbCommand] Executing SQL: INSERT INTO `tbl_test_float` (`amount`) VALUES (:yp0). Bound with :yp0=110399
2014/06/05 01:32:28 [trace] [system.db.CDbCommand] Executing SQL: INSERT INTO `tbl_test_float` (`amount`) VALUES (:yp0). Bound with :yp0=110400
My question is: Is this a bug of Yii?