Why can't I successfully compile J2ME code which has floats and/or doubles in it?

Bill Day

The J2ME Connected Limited Device Configuration (CLDC) does not support floats or doubles. Given that many of the devices implementing the CLDC do not have hardware support for floats/doubles, the CLDC expert group made the deliberate decision to not require float/double support.

Please refer to the J2ME CLDC specification for complete details of supported types and VM features:

CLDC device manufacturers may optionally support floats/doubles in their own devices, either via hardware or software. Developers may also choose to optionally support floats/doubles or fixed integer math in their own applications using software. For an example of a utility providing software-based fixed integer support, please refer to the MathFP entry in the "Tools and Utilities" section of the J2ME Archive: