Node:Converting Floats, Next:Float Arithmetic, Previous:Simultaneous Float Init & Assign, Up:Floating-point Functions
double mpf_get_d (mpf_t op) | Function |
Convert op to a double .
|
double mpf_get_d_2exp (signed long int exp, mpf_t op) | Function |
Find d and exp such that d times 2
raised to exp, with 0.5<=abs(d)<1, is a good
approximation to op. This is similar to the standard C function
frexp .
|
long mpf_get_si (mpf_t op) | Function |
unsigned long mpf_get_ui (mpf_t op) | Function |
Convert op to a long or unsigned long , truncating any
fraction part. If op is too big for the return type, the result is
undefined.
See also |
char * mpf_get_str (char *str, mp_exp_t *expptr, int base, size_t n_digits, mpf_t op) | Function |
Convert op to a string of digits in base base. base can be
2 to 36. Up to n_digits digits will be generated. Trailing zeros are
not returned. No more digits than can be accurately represented by op
are ever generated. If n_digits is 0 then that accurate maximum number
of digits are generated.
If str is If str is not The generated string is a fraction, with an implicit radix point immediately
to the left of the first digit. The applicable exponent is written through
the expptr pointer. For example, the number 3.1416 would be returned as
string When op is zero, an empty string is produced and the exponent returned is 0. A pointer to the result string is returned, being either the allocated block or the given str. |