January 26, 2021, 05:45:49 AM

Author Topic: [bb] IsOdd by * [ 1+ years ago ]  (Read 528 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] IsOdd by * [ 1+ years ago ]
« on: June 29, 2017, 12:28:42 AM »
Title : IsOdd
Author : *
Posted : 1+ years ago

Description : 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.


Code :
Code: BlitzBasic
  1. ;
  2. ;       Simple function to return 1 if the value is odd otherwise it will return 0
  3. ;       Coded by Ed Upton
  4. ;
  5.  
  6. Print IsOdd( 55 )
  7. WaitKey()
  8. End
  9.  
  10. Function IsOdd( value )
  11.         If value =0 Then Return 0
  12.        
  13.         If Float( value Mod 2 ) <>0 Then Return 1 Else Return 0
  14. End Function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal