Decoding a real number.
The following limitations exist: (1) only a binary format of base 2 is supported, (2) only exponent values that are represented in at most 24 bits is supported, and (3) only a maximun of 64 bits can be used to encode a mantissa. Even with these limitations a large P6FLOAT value can be decoded.
If either P6ASN1REAL_MINUSINFINITY or P6ASN1REAL_PLUSINFINITY is returned in the flags parameter, then the numValue parameter should be ignored. Infinity values are encoded as special values.
- Parameters
-
pBuffer | [ in ] Byte array containg the ASN.1 encoded data to decode |
bufSize | [ in ] the amount of data (in bytes) pointed to by pBuffer |
index | [ in ] current offset into pBuffer, should be pointing to the length field of a real tagged value [ out ] this index moves down the pBuffer data as the data is decoded |
numValue | [ in ] a decoded P6FLOAT value, unless an infinity constant returned in flags |
flags | [ in ] indicate a special value (e.g., minus infinity) |
- Returns
Success | P6R::eOk | |
Failure | P6R::eNotInitialized | A successful call to initialize was not made before this call. |
P6R::eInvalidArg | pBuffer is set to NULL. |
P6R::eFormatError | Could not properly decode type into IP address. |
P6R::eNotSupportedThe received encoding is not currently implemented. | |