diff --git a/include/fc/real128.hpp b/include/fc/real128.hpp index 3b66060..bfa288c 100644 --- a/include/fc/real128.hpp +++ b/include/fc/real128.hpp @@ -24,6 +24,8 @@ namespace fc { real128& operator -= ( const real128& o ); real128& operator /= ( const real128& o ); real128& operator *= ( const real128& o ); + + static real128 from_fixed( const uint128& fixed ); uint64_t to_uint64()const; diff --git a/src/real128.cpp b/src/real128.cpp index 3f5b431..0f0b759 100644 --- a/src/real128.cpp +++ b/src/real128.cpp @@ -112,6 +112,13 @@ namespace fc return number; } + + real128 real128::from_fixed( const uint128& fixed ) + { + real128 result; + result.fixed = fixed; + return result; + } void to_variant( const real128& var, variant& vo ) {