Flusspferd API and module docs

class gmp.Float

Description

Provides a bignum floating point class. See gmp’s mpf_class for the C++ API that is wrapped.

Includes

Instance methods

  • ceil #

    gmp.Float#ceil() ⇒ gmp.Float

    Returns the smallest integral value not less than this.

  • fitsInt #

    gmp.Float#fitsInt() ⇒ Boolean

    Checks if the value fits into an integer.

  • floor #

    gmp.Float#floor() ⇒ gmp.Float

    Returns the largest integral value not greater than this.

  • getInt #

    gmp.Float#getInt() ⇒ Integer

    Returns the value as an integer.

  • get_prec #

    gmp.Float#get_prec() ⇒ Integer

    Return the current precision of this, in number of bits.

  • set_prec #

    gmp.Float#set_prec(prec) ⇒ undefined
    • prec (Integer) – desired minimum precision.

    Set the precision of this to be at least prec bits. The value will be truncated to the new precision.

  • sqrt #

    gmp.Float#sqrt() ⇒ gmp.Float

    Returns the square root of this.

  • trunc #

    gmp.Float#trunc() ⇒ gmp.Float

    Return the integral value nearest to but not larger in magnitude then this.