This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Long to Float conversion" Watch "Long to Float conversion" New topic
Author

Long to Float conversion

malini griddaluri
Greenhorn

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?


Malini
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
Here are a couple of previous threads that discuss this issue:
http://www.coderanch.com/t/236562/java-programmer-SCJP/certification/widening-conversion-narrowing-conversion
and
http://www.coderanch.com/t/235941/java-programmer-SCJP/certification/long-Vs-float-double


Rob
SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Long to Float conversion
 
Similar Threads
Long to Float
Widening Conversion
float to int
Conversion from long to float
RHE - Conversion of primitives