omdl  v0.6.1
OpenSCAD Mechanical Design Library

Scalar data type identification. More...

+ Collaboration diagram for Scalars:

Files

file  datatypes-base.scad
 Include file wrapper of data types base primitives.
 

Functions

function is_defined (v)
 Test if a value is defined. More...
 
function not_defined (v)
 Test if a value is not defined. More...
 
function is_nan (v)
 Test if a numerical value is invalid. More...
 
function is_inf (v)
 Test if a numerical value is infinite. More...
 
function is_scalar (v)
 Test if a value is a single non-iterable value. More...
 
function is_iterable (v)
 Test if a value has multiple parts and is iterable. More...
 
function is_empty (v)
 Test if an iterable value is empty. More...
 
function is_number (v)
 Test if a value is a number. More...
 
function is_integer (v)
 Test if a value is an integer. More...
 
function is_decimal (v)
 Test if a value is a decimal. More...
 
function is_boolean (v)
 Test if a value is a predefined boolean constant. More...
 
function is_string (v)
 Test if a value is a string. More...
 
function is_list (v)
 Test if a value is an iterable list of values. More...
 
function is_range (v)
 Test if a value is a range definition. More...
 
function is_even (v)
 Test if a numerical value is even. More...
 
function is_odd (v)
 Test if a numerical value is odd. More...
 
function is_between (v, l, u)
 Test if a numerical value is between an upper and lower bounds. More...
 

Detailed Description

Scalar data type identification.

See validation results.

Function Documentation

function is_between ( ,
,
 
)

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 between the upper and lower bounds and false otherwise.

+ Here is the caller graph for this function:

function is_boolean ( )

Test if a value is a predefined boolean constant.

Parameters
v<value> A value.
Returns
<boolean> true when the value is one of the predefined boolean constants [true|false] and false otherwise.
function is_decimal ( )

Test if a value is a decimal.

Parameters
v<value> A value.
Returns
<boolean> true when the value is a decimal and false otherwise.
function is_defined ( )

Test if a value is defined.

Parameters
v<value> A value.
Returns
<boolean> true when the value is defined and false otherwise.

+ Here is the caller graph for this function:

function is_empty ( )

Test if an iterable value is empty.

Parameters
v<value> An iterable value.
Returns
<boolean> true when the iterable value has zero elements and false otherwise.

+ Here is the caller graph for this function:

function 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 even and false otherwise (The value may be positive or negative).
function 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 representable number) and false otherwise.
function is_integer ( )

Test if a value is an integer.

Parameters
v<value> A value.
Returns
<boolean> true when the value is an integer and false otherwise.
function is_iterable ( )

Test if a value has multiple parts and is iterable.

Parameters
v<value> A value.
Returns
<boolean> true when the value is an iterable multi-part value and false otherwise.
data type defined
number(s) false
boolean false
string true
list true
range not defined
undef false
inf false
nan false
function is_list ( )

Test if a value is an iterable list of values.

Parameters
v<value> A value.
Returns
<boolean> true when the value is a list and false otherwise.
function is_nan ( )

Test if a numerical value is invalid.

Parameters
v<value> A numerical value.
Returns
<boolean> true when the value is determined to be nan (Not A Number) and false otherwise.

+ Here is the caller graph for this function:

function is_number ( )

Test if a value is a number.

Parameters
v<value> A value.
Returns
<boolean> true when the value is a number and false otherwise.
Note
Returns true for inf and nan values.
function 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 odd and false otherwise (The value may be positive or negative).
function is_range ( )

Test if a value is a range definition.

Parameters
v<value> A value.
Returns
<boolean> true when the value is a range definition and false otherwise.
function is_scalar ( )

Test if a value is a single non-iterable value.

Parameters
v<value> A value.
Returns
<boolean> true when the value is a single non-iterable value and false otherwise.
data type defined
number(s) true
boolean true
string false
list false
range not defined
undef true
inf true
nan true

+ Here is the caller graph for this function:

function is_string ( )

Test if a value is a string.

Parameters
v<value> A value.
Returns
<boolean> true when the value is a string and false otherwise.

+ Here is the caller graph for this function:

function not_defined ( )

Test if a value is not defined.

Parameters
v<value> A value.
Returns
<boolean> true when the value is not defined and false otherwise.

+ Here is the caller graph for this function: