real128: Implement from_fixed() to initialize real128 from fixed point value
This commit is contained in:
parent
27e224b012
commit
51033bcb12
2 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue