# ArrayToFP8 Copies an array of type float or double into an array of type [uchar](/en/docs/basis/types/integer/integertypes#uchar) with the given format. ``` bool   ArrayToFP8(    const uchar&         dst_array[],        // copy to    const float&         src_array[],        // copy from    ENUM_FLOAT8_FORMAT   fmt                 // format    ); ``` Overloading for the double type ``` bool   ArrayToFP8(    const uchar&         dst_array[],        // copy to    const double&        src_array[],        // copy from    ENUM_FLOAT8_FORMAT   fmt                 // format    ); ``` 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](/en/docs/onnx/onnx_structures#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](/en/docs/onnx/onnx_structures#enum_float8_format) enumeration and are used in MQL5 only for operations with [ONNX models](/en/docs/onnx). The function converts input parameters of type float or double into one of FP8 types. These input parameters are then used in the [OnnxRun](/en/docs/onnx/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 ](https://www.mql5.com/ru/articles/14330) ``` //+------------------------------------------------------------------+ //| RunCastFloat8Float                                               | //+------------------------------------------------------------------+ bool RunCastFloat8ToFloat(long model_handle,const ENUM_FLOAT8_FORMAT fmt)   {    PrintFormat("TEST: %s(%s)",__FUNCTION__,EnumToString(fmt)); //---    float test_data[15]   = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};    uchar data_float8[15] = {};    if(!ArrayToFP8(data_float8,test_data,fmt))      {       Print("error in ArrayToFP8. error code=",GetLastError());       OnnxRelease(model_handle);       return(false);      }    U input_float8_values[3*5];    U output_float_values[3*5];    float    test_data_float[]; //--- convert float8 to float    if(!ArrayFromFP8(test_data_float,data_float8,fmt))      {       Print("error in ArrayFromFP8. error code=",GetLastError());       OnnxRelease(model_handle);       return(false);      }    for(uint i=0; i