Syntax
r=isodd(x)
Input Parameter
Output Parameter
Copyright 2012-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, isodd
, determines whether a given number x
is odd.
Input Parameters
- x: A number that you want to check for oddness.
Output Results
- r: A boolean value that is
true
if the number x
is odd, and false
if it is even.
Algorithm Explanation
The function uses the modulus operation to determine if a number is odd. The modulus operation mod(x,2)
calculates the remainder when x
is divided by 2.
- If
mod(x,2) ~= 0
, it means the remainder is not zero, indicating that x
is odd, and the function returns true
.
- If
mod(x,2) == 0
, it means the remainder is zero, indicating that x
is even, and the function returns false
.
Additional Information
This function is part of the SolidGeometry library and was introduced in version 1.0. It is categorized under auxiliary procedures and was created by Tim C. Lueth.
Related functions include isinteger
and isintegerbv
, which may be used for checking integer properties.
Algorithm explaination created using ChatGPT on 2025-08-18 21:51. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21