正确的方法来模拟Python中的单精度浮点? [英] Correct way to emulate single precision floating point in python?

查看:1087
本文介绍了正确的方法来模拟Python中的单精度浮点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在python中模拟单精度浮点的最好方法是什么? (或者其他浮点格式呢?)只要使用ctypes?

解决方案

numpy 有一个 float32 类型。


What's the best way to emulate single-precision floating point in python? (Or other floating point formats for that matter?) Just use ctypes?

解决方案

numpy has a float32 type.

这篇关于正确的方法来模拟Python中的单精度浮点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆