diff --git a/libuavcan/include/uavcan/marshal/float_spec.hpp b/libuavcan/include/uavcan/marshal/float_spec.hpp index b77328f44a..1e8627c052 100644 --- a/libuavcan/include/uavcan/marshal/float_spec.hpp +++ b/libuavcan/include/uavcan/marshal/float_spec.hpp @@ -36,9 +36,10 @@ struct NativeFloatSelector class UAVCAN_EXPORT IEEE754Converter { - // TODO: Non-IEEE float support for float32 and float64 - static uint16_t nativeNonIeeeToHalf(float value); - static float halfToNativeNonIeee(uint16_t value); + // TODO: Non-IEEE float support + + static uint16_t nativeIeeeToHalf(float value); + static float halfToNativeIeee(uint16_t value); IEEE754Converter(); @@ -80,13 +81,13 @@ template <> inline typename IntegerSpec<16, SignednessUnsigned, CastModeTruncate>::StorageType IEEE754Converter::toIeee<16>(typename NativeFloatSelector<16>::Type value) { - return nativeNonIeeeToHalf(value); + return nativeIeeeToHalf(value); } template <> inline typename NativeFloatSelector<16>::Type IEEE754Converter::toNative<16>(typename IntegerSpec<16, SignednessUnsigned, CastModeTruncate>::StorageType value) { - return halfToNativeNonIeee(value); + return halfToNativeIeee(value); } diff --git a/libuavcan/src/marshal/uc_float_spec.cpp b/libuavcan/src/marshal/uc_float_spec.cpp index 233de0ec84..1e2c68bd9d 100644 --- a/libuavcan/src/marshal/uc_float_spec.cpp +++ b/libuavcan/src/marshal/uc_float_spec.cpp @@ -11,7 +11,7 @@ namespace uavcan /* * IEEE754Converter */ -uint16_t IEEE754Converter::nativeNonIeeeToHalf(float value) +uint16_t IEEE754Converter::nativeIeeeToHalf(float value) { /* * https://github.com/numpy/numpy/blob/master/numpy/core/src/npymath/halffloat.c @@ -103,7 +103,7 @@ uint16_t IEEE754Converter::nativeNonIeeeToHalf(float value) return uint16_t(h_sgn + h_exp + h_sig); } -float IEEE754Converter::halfToNativeNonIeee(uint16_t value) +float IEEE754Converter::halfToNativeIeee(uint16_t value) { /* * https://github.com/numpy/numpy/blob/master/numpy/core/src/npymath/halffloat.c