Skip to content

Add convenience functions for conversion to primitive integer types. #28

@stencillogic

Description

@stencillogic

Consider adding conversion functions to primitive integer types.
Possible signatures (<int_type> is i8, i16, i32, i64, i128, u8, u16,u32, u64, u128):

  • BigFloat::try_to_<int_type>(&self, RoundingMode) -> Result<<int_type>, Error>: returns Error if BigFloat's absolute values is larger than the the value <int_type> can hold.
  • BigFloat::to_<int_type>_saturating(&self, RoundingMode) -> <int_type>: if the value of BigFloat is larger than the value that <int_type> can hold, clamp the value to the maximum value of <int_type>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions