Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

Understand how float columns work (no replies)

$
0
0
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.

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>