Code archives/Algorithms/IsOdd

This code has been declared by its author to be Public Domain code.

Download source code

IsOdd by *2004
This functions returns 1 if the value is odd otherwise it will return 0.

Syntax is: returnvalue = IsOdd( value )

value is the value you wish to know about and return value is either 0 or 1.
;
;	Simple function to return 1 if the value is odd otherwise it will return 0
;	Coded by Ed Upton
;

Print IsOdd( 55 )
WaitKey()
End

Function IsOdd( value )
	If value =0 Then Return 0
	
	If Float( value Mod 2 ) <>0 Then Return 1 Else Return 0
End Function

Comments

None.

Code Archives Forum