Skip navigation links

MySQL Forums :: Connector/JDBC and Java :: Problems with extreme float values


Advanced Search

Re: Problems with extreme float values
Posted by: Mark Matthews ()
Date: July 30, 2008 12:09PM

Steve Appling Wrote:
-------------------------------------------------------
[snip]
> How can I store any of these valid float values in
> a float column? I thought the float datatype
> could hold any IEEE 754 4 byte value. Is this a
> bug or am I doing something wrong?

Steve,

You can't, at least not without coding something up yourself to round or floor it, or having another column that holds +/-INF or NaN bits/flags. Standard SQL's FLOAT (not just MySQL's) is *not* an IEEE754 float, and doesn't allow for +/-INF of NaN.

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject Written By Posted
Problems with extreme float values Steve Appling 07/30/2008 11:34AM
Re: Problems with extreme float values Mark Matthews 07/30/2008 12:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.