cast changes value
| From: | Martín Marqués | Date: | Thu, 19 Aug 2010 18:46:37 +0000 |
| Subject: | cast changes value | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-307577@lists.php.net to get a copy of this message | ||
I have values with 2 decimals that I multiple by 100 to make them
integers, but to be sure I do a cast using (int).
The thing is that (int) is changing the value of the integer. Here is
a var_dump of the original value, the value * 100, and the value after
casting to int.
string(5) "34.80"
float(3480)
int(3479)
Using floor() those the exact same thing.
Why is this?
--
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador