aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Conversion rules Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Conversion rules" Watch "Conversion rules" New topic

Conversion rules

Richa Jeetah

Joined: Sep 27, 2001
Posts: 29
Why does int or long get converted to float
int is 32 bits
long is 64 bits
and float is only 32 bits
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12981
Because float can correctly represent the magnitude of any int or long, in spite of the fact that some bits of precision are lost.
Its all in the lanquage specification.
Richa Jeetah

Joined: Sep 27, 2001
Posts: 29
will check it out.
It is sorta covered in the JavaRanch Style Guide.
subject: Conversion rules
jQuery in Action, 3rd edition