Difference between revisions of "Set"

189 bytes added ,  13:14, 17 April 2006
m
no edit summary
imported>JOG
m
imported>JOG
m
Line 32: Line 32:
  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 your variable is an integer and you want the result to be rounded you need to add 0.5:  
When your variable is an integer and you want the result to be rounded you need to use a decimal point in the division and add 0.5:  
  short a
  short a
  set a to 9.0/5+0.5 ; will set "a" to 2
set a to 9/5          ; will set "a" to 1
  set a to 7.0/5+0.5 ; will set "a" to 1
set a to 9/5  + 0.5  ; will set "a" to 1
set a to 9.0/5        ; will set "a" to 1
  set a to 9.0/5 + 0.5 ; will set "a" to '''2'''
  set a to 7.0/5 + 0.5 ; will set "a" to '''1'''




Anonymous user