站内搜索: 请输入搜索关键词
当前页面: 图书首页 > Wireless Java Developing with J2ME, Second Edition

No Floating Point in CLDC 1.0 - Wireless Java Developing with J2ME, Second Edition

Previous Section Next Section

No Floating Point in CLDC 1.0

One overarching change is that CLDC 1.0 does not support floating-point types at all. That means there are no float or double primitive types. The corresponding wrapper types, java.lang.Float and java.lang.Double, have also been eliminated.

Floating point support is absent in CLDC 1.0 because most small devices don't have hardware support for floating-point operations. If calculations involving fractional numbers are important to your application, you can perform them in software. One implementation (using fixed-point integers) can be found at http://home.rochester.rr.com/ohommes/MathFP/.

CLDC 1.1 includes floating point support, the primitive types double and float, and the wrapper types Double and Float. Various other classes have been modified for floating-point support in CLDC 1.1, but the changes are minor.


Previous Section Next Section