Tests to differentiate scalar data types.
More...
Tests to differentiate scalar data types.
Validation Summary
No Failures
See complete validation results.
◆ is_between()
function is_between |
( |
v |
, |
|
|
l |
, |
|
|
u |
|
|
) |
| |
Test if a numerical value is between an upper and lower bounds.
- Parameters
-
v | <number> A numerical value. |
l | <number> The minimum value. |
u | <number> The maximum value. |
- Returns
- <boolean> true when the value is equal to or between the upper and lower bounds and false otherwise. Returns false when either of
v
, l
, or u
is not a number.
◆ is_decimal()
function is_decimal |
( |
v |
| ) |
|
Test if a value is a decimal.
- Parameters
-
- Returns
- <boolean> true when the value is a decimal and false otherwise.
◆ is_defined()
function is_defined |
( |
v |
| ) |
|
Test if a value is defined.
- Parameters
-
- Returns
- <boolean> true when the value is defined and false otherwise.
- Note
- Starting with version 2019.05, this function is now provided directly by OpenSCAD via a built-in type test function
is_undef()
.
◆ is_even()
Test if a numerical value is even.
- Parameters
-
v | <value> A numerical value. |
- Returns
- <boolean> true when the value is determined to be an even integer and false otherwise (The value may be positive or negative).
◆ is_inf()
Test if a numerical value is infinite.
- Parameters
-
v | <value> A numerical value. |
- Returns
- <boolean> true when the value is determined to be inf (greater than the largest OpenSCAD representable number) and false otherwise.
◆ is_integer()
function is_integer |
( |
v |
| ) |
|
Test if a value is an integer.
- Parameters
-
- Returns
- <boolean> true when the value is an integer and false otherwise.
◆ is_nan()
Test if a numerical value is 'nan' (not a number).
- Parameters
-
v | <value> A numerical value. |
- Returns
- <boolean> true when the value is determined to be nan (Not A Number) and false otherwise.
◆ is_number()
Test if a value is a number.
- Parameters
-
- Returns
- <boolean> true when the value is a number and false otherwise.
- Note
- Starting with version 2019.05, this function is now provided directly by OpenSCAD via a built-in type test function
is_num()
.
◆ is_odd()
Test if a numerical value is odd.
- Parameters
-
v | <value> A numerical value. |
- Returns
- <boolean> true when the value is determined to be an odd integer and false otherwise (The value may be positive or negative).
◆ is_range()
Test if a value is a range definition.
- Parameters
-
- Returns
- <boolean> true when the value is a range definition and false otherwise.
- Note
- A range is determined to be a value which does not fit in any other category. Specifically, It is a value that is not {undef, nan or inf}, and is neither of {list, number, bool, or string}.
◆ is_scalar()
Test if a value is a single non-iterable value.
- Parameters
-
- Returns
- <boolean> true when the value is a single non-iterable value and false otherwise.
input value | function return |
number | true |
boolean | true |
string | false |
list | false |
range | true |
undef | true |
inf | true |
nan | true |
- Note
- The empty list and empty string return true.