Re: [Modeling-users] Re: MySQL double
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2004-02-04 05:44:44
|
Mario Ruggier <ma...@ru...> wrote: [speaking of DOUBLE vs FLOAT in mysql, for floats like 1.24e-127] > wouldn't this be an appropriate case for using FixedPoint? As per: > <http://modeling.sourceforge.net/UserGuide/attribute-custom-type- > example.html> > Or are there other reasons, maybe performance?, for not doing so? Well, probably not in this case, or you'll need a precision of 129 to represent 1.24e-127 correctly with FixedPoint ;) FixedPoint is really fixed, relative to zero. The problem here was just the range of valid values on mysql side: the minimum acceptable value for a FLOAT is +/-1.1E-38, that's why 1e-127 was rounded to 0; but with DOUBLE the min. value is +/-1.8-308. (http://www.mysql.com/doc/en/Column_types.html) BTW and in relation to the topic, PEP 327: Decimal Data Type was announced a few days ago, see at: http://groups.google.com/groups?selm=3Dmailman.1036.1075467073.12720.python= -list%40python.org (seen on daily python today) -- S=E9bastien. |