在黑莓上浮动还是双倍?
Can you use double or float on Blackberry?
If so, in which OS version or hardware model?
Edit: I believe the answers I get here, but then something else must be the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
显然,浮点在某些版本的 Blackberry 上不起作用;看评论。
Bow,如果 J2ME 设备实现 CLDC 1.0 配置文件,则制造商不需要在平台中包含对浮点运算的支持:请参阅
在 CLDC 1.1 中,浮点支持是强制性的。
在其他问题的评论中,您说 Blackberry 是 CLDC 1.1。
如果您的 Blackberry 浮点支持不起作用,并且它确实声称实现 CLDC 1.1,那么这要么是执行平台或构建工具链中的错误,要么是您使用方式的问题 工具链。 (我不开发 J2ME 的东西,所以我不能更具体。)
Apparently floating point doesn't work on some versions of Blackberry; see the comments.
Bow, if a J2ME device implements the CLDC 1.0 profile, the manufacturer is not required to include support for floating point arithmetic in the platform: see
In CLDC 1.1, floating point support is mandatory.
In comments on other questions, you say that Blackberry is CLDC 1.1.
If your Blackberry's floating point support doesn't work and it really claims to implement CLDC 1.1, then that's either a bug in the execution platform or the build tool-chain, or a problem with the way you are using the tool-chain. (I don't develop J2ME stuff, so I can't be more specific.)
我不久前写了一篇文章,展示了黑莓上不同数据类型和不同算术处理的时间比较。您可能不会寻找此类信息,但了解您的选择如何比较很有趣。
http://www.blurrywords.com/2009/05 /02/blackberry-java-arithmetic-comparisons.html
I put a post together a while back that shows a timing comparison with the different data types and different arithmetic processing on the BlackBerry. You might not be looking for this type of information, but it's interesting to see how your options compare.
http://www.blurrywords.com/2009/05/02/blackberry-java-arithmetic-comparisons.html
唯一不支持浮点类型的 Java 版本是 Java ME 版本中的 CLDC 配置 1.0(它们在版本 1.1 中重新添加)。我不确定是否有任何 Blackberry 设备仅支持 CLDC 1.0,但我对此表示怀疑。
The only Java version that does not support floating-point types is the CLDC configuration of Java ME in Version 1.0 (they were re-added in Version 1.1). I'm not sure whether there are any Blackberry devices that only support CLDC 1.0, but I doubt it.
您可以在任何 Blackberry 操作系统和硬件型号上使用
double
或float
。You can use
double
orfloat
on any Blackberry OS and hardware model.