Turing Help ( Variables, and how they work )
Author |
Message |
replay
|
Posted: Thu Oct 30, 2008 8:44 pm Post subject: Turing Help ( Variables, and how they work ) |
|
|
Well, i kinda lost my note about this from class today.. and i needa do homework so...
anybody know the rule for the variables when u use " / " , " mod " and " div" ?
for example
expression = x : 11 mod 2.5
data type of x = real, or integer? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Thu Oct 30, 2008 8:49 pm Post subject: RE:Turing Help ( Variables, and how they work ) |
|
|
You need to know the difference between int and real types. You also need to know what kind of a value each of those operations return. Then match the two up.
You could always just set up some super simple test cases in Turing, and see what kind of answers they return.
Should make it pretty obvious as to how div is different from / |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|
|