提问人:Kannan Ramamoorthy 提问时间:4/28/2023 最后编辑:BarmarKannan Ramamoorthy 更新时间:4/28/2023 访问量:30
Mysql useServerPrepStmts 影响查询浮点值的精度
Mysql useServerPrepStmts affects the precision of queried float value
问:
在我们的应用程序中,由于各种原因,我们不得不将 Mysql 连接参数从 更改为 。useServerPrepStmts
true
false
更改后,我们发现,这开始影响从 DB 查询的列值的精度。当参数为 时,我们正好得到了我们所设置的内容。设置为 后,浮点值将四舍五入为 5 位数字。float
true
false
知道为什么会发生这种情况以及解决它的正确方法是什么吗?
答: 暂无答案
下一个:浮点数学坏了吗?
评论
float
始终是近似的数值数据类型,因此不应依赖它不四舍五入。阅读 dev.mysql.com/doc/refman/8.0/en/problems-with-float.html