Option Explicit 'Script written by Russell Loveridge 'Script copyrighted by RAL:lapa.epfl.ch ' NOTE: this script can be massively simplified but is written out in long form to assist students with understanding the process. Call IntIt() Sub IntIt() ' this script shows how to make an integer out of a real number. ' NOTE: The INT fuction does not "round" the number! ' It only deletes the fraction after the "non-fraction" number ' so 1.25 becomes = 1, 2.95 becomes = 2 399.99999999 becomes = 399 Dim dblNumber ' This is the original number to be tested Dim dblEval ' This is the original number divided by 2 - this will give a real number or an integer Dim intInteger ' This is the INTEGERIZED number from above Dim dblTest ' This is the final test: if = 0 then it is even, if not then it is odd. dblNumber = Rhino.GetReal("Input any number",1.5) 'ask user for a number dblEval = (dblNumber/2) ' divide the number by 2 intInteger = Int (dblEval) ' create the INTEGERIZED version of the number dblTest = (dblEval - intInteger) ' subtract the INTEGERIZED number Rhino.print "The result is: " & dblTest ' print the result If dblTest = 0 Then ' if = 0, then the number is even (pair). Rhino.print "The number was even. " Else ' if <>= 0, then the number is odd (impair). Rhino.print "The number was odd. " End If End Sub