This code does not work. Any suggestions?
float tempNum = 0.590000;
int temporary;
if (tempNum >= 0.590000 && tempNum <= 0.610000){
temporary = 15;
}
// temporary yields zero
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So:
By default 0.590000 is a DOUBLE
So
float tempNum = 0.59000causes a cast.To prove this try:
So, remember that:
aaa.aaa is a DOUBLE
aaa.aaaf is FLOAT