You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default number of decimal places displayed is seven, but MySQL uses the full double-precision value internally.
So, PI() is 3.141593, but PI() + 0e0 is 3.141592653589793
And, PI() = 3.141592653589793 is TRUE because the displayed value and actual value are different.
However, database drivers don't generally know about this
So, you might think a MySQL driver would return the "actual" value of PI()
And not the "display" value of PI()
Nope
MySQL drivers return the "display" value of PI()
!@#$%^&*
You know how one of the oft-touted rules for databases is to decouple data and representation?
MySQL really ignores that rule for the PI() functions.
https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html#function_pi
So,
PI()
is 3.141593, butPI() + 0e0
is 3.141592653589793And,
PI() = 3.141592653589793
isTRUE
because the displayed value and actual value are different.However, database drivers don't generally know about this
So, you might think a MySQL driver would return the "actual" value of PI()
And not the "display" value of PI()
Nope
MySQL drivers return the "display" value of PI()
!@#$%^&*
This gives weird shit like,
We also have,
The text was updated successfully, but these errors were encountered: