Computer Science Canada using real numbers in case? |
Author: | bvbjules13 [ Sat Jan 12, 2013 5:14 pm ] | ||
Post subject: | using real numbers in case? | ||
What is it you are trying to achieve? i am trying to use a decimal (or real number) in a case statement What is the problem you are having? keep getting message of "Bad type for case expression" Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1 |
Author: | Insectoid [ Sat Jan 12, 2013 5:34 pm ] |
Post subject: | RE:using real numbers in case? |
There's a much, much easier way to do this. Look up the 'mod' operator. Also, if your case statement only has one case (plus the default case), you probably shouldn't be using a case statement. |