[Python-Dev] trunc() (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Fri Jan 25 20:39:17 CET 2008
- Previous message: [Python-Dev] trunc()
- Next message: [Python-Dev] trunc()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Raymond Hettinger <python rcn.com> writes:
Go ask a dozen people if they are surprised that int(3.7) returns 3. No one will be surprised (even folks who just use Excel or VB). It is foolhardy to be a purist and rage against the existing art:
Well, for what it's worth, here are MySQL's own two cents:
mysql> create table t (a int); Query OK, 0 rows affected (0.00 sec)
mysql> insert t (a) values (1.4), (1.6), (-1.6), (-1.4); Query OK, 4 rows affected (0.00 sec) Records: 4 Duplicates: 0 Warnings: 0
mysql> select * from t; +------+ | a | +------+ | 1 | | 2 | | -2 | | -1 | +------+ 4 rows in set (0.00 sec)
- Previous message: [Python-Dev] trunc()
- Next message: [Python-Dev] trunc()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]