3 ms·
better than half precision, but will still burn you is the FLOAT type in MySQL. It's single precision, not double precision, which is expected these days in fl
by jgalt212 6y ago
better than half precision, but will still burn you is the FLOAT type in MySQL. It's single precision, not double precision, which is expected these days in floats.
https://dev.mysql.com/doc/refman/8.0/en/floating-point-types.html https://dev.mysql.com/doc/refman/8.0/en/floating-point-types...
- Firadeoclus 6y ago> double precision, which is expected these days in floats. Some people will expect it to be double precision (e.g. Python programmers) whereas others will expect it to be single precision (e.g. C/C++ programmers).
- nmca 6y agoPet peeve of mine when people call these types anything other than f32, f64 etc. Surely we should have learned by now!
- thechao 6y agoWhich f16? For GPUs I know of three format-different fp’s used in common practice. For f32 there’s (generally) two format compatible, semantic diverging variants. And that doesn’t even take into account sub-behaviors of “standard” IEEE-754.
- jgalt212 6y agofair enough, but I guess we can agree then that "float" is a vague term. And when a term is vague, it's probably best to default to the least likely to do damage actual definition.
- jleedev 6y agoMysql also applies additional rounding to floats if you're not careful: mysql> create table t(f float); Query OK, 0 rows affected (0.02 sec) mysql> insert into t(f) values (999999),(1000000),(1000001); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select distinct f from t; +---------+ | f | +---------+ | 999999 | | 1000000 | | 1000000 | +---------+ 3 rows in set (0.00 sec) mysql>