File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Long to Float conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Long to Float conversion" Watch "Long to Float conversion" New topic

Long to Float conversion

malini griddaluri

Joined: May 07, 2002
Posts: 5
Hi All ,
I have a very basic doubt as to how can a conversion from long to float not require any explicit casting or why is it known as widening conversion?
Long is 64 bits and float is 32 bits so doesn't the number get truncated when a cast occurs?

Rob Ross

Joined: Jan 07, 2002
Posts: 2205
Here are a couple of previous threads that discuss this issue:

SCJP 1.4
I agree. Here's the link:
subject: Long to Float conversion
It's not a secret anymore!