The OpenD Programming Language

deserializeValueImpl

Deserialize floating point value.

More...

Detailed Description

Examples

import mir.ion.value;
import mir.ion.exception;
// from ion float
auto data = IonValue([0x44, 0x42, 0xAA, 0x40, 0x00]).describe;
double value;

assert(deserializeValueImpl(data, value) == IonErrorCode.none);
assert(value == 85.125);

// from ion double
data = IonValue([0x48, 0x40, 0x55, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00]).describe;

assert(deserializeValueImpl(data, value) == IonErrorCode.none);
assert(value == 85.125);

// from ion decimal
data = IonValue([0x56, 0x00, 0xcb, 0x80, 0xbc, 0x2d, 0x86]).describe;

assert(deserializeValueImpl(data, value) == IonErrorCode.none);
assert(value == -12332422e75);

Meta