January 26, 2021, 05:45:49 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Algorithms
»
[bb] IsOdd by * [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] IsOdd by * [ 1+ years ago ] (Read 528 times)
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
;
; 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...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Algorithms
»
[bb] IsOdd by * [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal