View Single Post
Old Apr 13th, 2008, 12:15 AM   #8
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 837
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Re: Random "Letter" Generator

Quote:
Originally Posted by manny85 View Post
The reason I choose the Switch statement was mainly because I don't think that if a user inputs a letter that ".parseDouble" converts it to a numeric value. So my reasoning was that if they only guess letters they'll never succeed with that system. Please correct me if I'm wrong in that logic.[/url]
The Double.parseDouble function will convert a String to a double. However, you are correct in that floating-point numbers are inherently inexact and as such any comparisons involving a floating-point number is likely to yield incorrect results.
titaniumdecoy is offline   Reply With Quote