Difference between revisions of "Set"

6 bytes added ,  12:45, 17 April 2006
m
no edit summary
imported>JOG
m
imported>JOG
m
Line 35: Line 35:
  set a to 9.0/5  ; will set "a" to 1.800
  set a to 9.0/5  ; will set "a" to 1.800


*When you want to store the correctly rounded result of a division in an integer-variable, you need to make sure the calculation uses floating poing (so that the decimal-fraction isn't truncated) and add 0.5:  
*When you want to store the correctly rounded result of a division in an integer-variable, you need to make sure, that the calculation uses floating poing (so that the decimal-fraction isn't truncated) and add 0.5:  
  short a
  short a
  set a to 9/5          ; will set "a" to 1
  set a to 9/5          ; will set "a" to 1
Anonymous user