MySQL Forums
Forum List  »  Connector/C++

Understand how float columns work
Posted by: P K
Date: May 02, 2022 01:00PM

I'm trying to insert a max float value to a column defined as float and I encountered out of range error. According to documenatation the maximum of float is 3.402823466E+38 but maximum float precision is 23 bits which is 7 decimal places. Now I wrote an application in c++ which inserts a values as float single-precision value 3.4028235E+38 and then error occured. In c++ these two numbers are treat as equal: 3.402823466E+38 and 3.4028235E+38 in mysql they are not, why?

And second question, what does it mean "The actual range might be slightly smaller depending on your hardware or operating system."? How the range depends on hardware? In my case described above server and client run on the same machine x86-64bit but server is 64 bit app and client 32 bit.

Options: ReplyQuote


Subject
Views
Written By
Posted
Understand how float columns work
708
P K
May 02, 2022 01:00PM


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.