Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Paul Clapham
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Saloon Keepers:
Tim Holloway
Carey Brown
Roland Mueller
Piet Souris
Bartenders:
Forum:
Programmer Certification (OCPJP)
Question about "=="
Scott Xia
Greenhorn
Posts: 20
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
code block under:
System.out.println(0.9F==0.9D); //get flase
System.out.println(10.0F==10.0D); //get true
System.out.println(10==10.0D); //get true
anyone clear me on this question ,thanks
Valentin Crettaz
Author & Gold Digger
Posts: 7617
6
I like...
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
it's some kind of precision problem, i.e.
float f = 0.9f;
double d = 0.9d;
System.out.println((double)f);
System.out.println(d);
prints
0.8999999761581421
0.9
Does it clears things up ?
Val
My Linked In
Scott Xia
Greenhorn
Posts: 20
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thank you i got it
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
urgent!!!!not getting logic
unreachable code
division by zero
Question from Dans Test
generate random number in a range?
More...