|
ArrayToFP8
Copies an array of type float or double into an array of type uchar with the given format.
bool ArrayToFP8(
|
Overloading for the double type
bool ArrayToFP8(
|
Parameters
dst_array[]
[out] Receiver array or type uchar.
src_array[]
[in] Source array of type float or double.
fmt
[in] Copying format from the ENUM_FLOAT8_FORMAT enumeration.
Return Value
Returns true if successful or false otherwise.
Note
All kinds of FP8 format are defined in the ENUM_FLOAT8_FORMAT enumeration and are used in MQL5 only for operations with ONNX models.
The function converts input parameters of type float or double into one of FP8 types. These input parameters are then used in the OnnxRun function.
FP8 (8-bit floating point) is one of the data types used to represent floating point numbers. In FP8, each number is represented by 8 data bits, typically divided into three components: sign, exponent and mantissa. This format offers a balance between accuracy and storage efficiency, making it attractive for applications that require memory and computational efficiency.
By employing compact number representation, FP8 reduces memory requirements and accelerates calculations. In addition, FP8 can be useful for implementing low-level operations such as arithmetic calculations and signal processing.
Example: function from the article Working with ONNX models in float16 and float8 formats
//+------------------------------------------------------------------+
|
See also