About
The MAXON API defines multiple primitive mathematical data types. These data types are the building blocks for more complex data types.
- Note
- These data types should be used instead of the standard C++ data types.
Bool
maxon::Bool stores a Boolean value.
if (boolean)
Definition: datatypebase.h:1199
Result< void > Set(T &&data)
Definition: datatypebase.h:1393
Result< typename std::conditional< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, T, typename ByValueParam< T >::type >::type > Get() const
Definition: datatypebase.h:1404
bool Bool
boolean type, possible values are only false/true, 8 bit
Definition: apibase.h:181
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:176
#define iferr_return
Definition: resultbase.h:1519
Int
Different integer type of the sizes 16, 32 and 64 bit are defined:
int64_t Int64
64 bit signed integer datatype.
Definition: apibase.h:178
If such a integer value should be converted to a floating point value one must consider the limits of such conversion. Values outside that limit will result in an overflow.
- Note
- For bigger integer values use maxon::BigInteger.
Float
Floating point data types are available in 32 and 64 bit size:
- Note
- A number can also be cast into a maxon::Float using the "_f" operator.
float Float32
32 bit floating point value (float)
Definition: apibase.h:182
Floating point data is a complex data type that could be corrupted.
Two floating point values (that are not exactly zero) should not be compared with "==".
Py_UNICODE c
Definition: unicodeobject.h:1200
Float64 Float
Definition: apibase.h:197
Bool CompareFloatTolerant(Float32 a, Float32 b)
Different floating point data types have different minimum and maximum values:
Multiplying two float values could result in an overflow. These constants define safe ranges that can be used without the risk of such an overflow.
When a floating point value is converted into another scalar value it could easily exceed the range of valid values of the target type. A safe conversation is done with:
Py_UCS4 * res
Definition: unicodeobject.h:1113
int32_t Int32
32 bit signed integer datatype.
Definition: apibase.h:176
Char
A character is a single symbol.
See also String Manual.
Limit
The Limit template class defines the minimum and maximum vale a given scalar type can store. An example is maxon::LIMIT<maxon::Int64>:
- maxon::LIMIT<maxon::Int64>::MIN: The minimum value of the data type.
- maxon::LIMIT<maxon::Int64>::MAX: The maximum value of the data type.
{
if (!values)
{
}
}
PyObject * value
Definition: abstract.h:715
Definition: basearray.h:412
Definition: apibasemath.h:54
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:188
return OK
Definition: apibase.h:2690
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
const char Py_ssize_t const char Py_ssize_t Py_ssize_t max
Definition: modsupport.h:59
const char Py_ssize_t const char Py_ssize_t min
Definition: modsupport.h:58
Further Reading