float java-me j2me [duplicate]
Possible Duplicate:
Java - simple division in Java ---> bug/feature?
anyone know bigdecimal in j2me midp 2.0?
actually i just want to make j2me app, which is able to compute 1 / 6. and print it as 0.1666667. just like embedded calculator in many(every) mobile phone.
i use float it prints 0.0 i use double it still prints 0.0
many thanks.
@Vuntic: yeah..., this is stupid question ever. @Matt: thx, now i know the answer referring from the link question...
just cast it to float.. (float) 1 / (float) 6
精彩评论