| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
make-rectangular returns x1 + ix2.
make-polar returns x1e^(ix2).
real-part and imag-part return z's real and imaginary
part, respectively. magnitude and angle return
z's magnitude and angle, respectively.
#(m, e, sign),
where
x = (* sign m (expt 2.0 e)) sign is either 1, 0 or -1. |
(decode-float 3.1415926) => #(7074237631354954 -51 1) (* 7074237631354954 (expt 2.0 -51)) => 3.1415926 |
Fmod computes the remainder of dividing x
by y, that is, it returns x-n*y where
n is the quotient of x/y rounded towards zero
to an integer. Modf returns two values; a fractional
part of x and an integral part of x. Frexp
returns two values, fraction and exponent of x,
where x = fraction * 2^exponent, and
0 <= fraction <= 0.5. Ldexp is a reverse operation of
frexp; it returns a real number x * 2^n.
(fmod 32.1 10.0) => 2.1 (fmod 1.5 1.4) => 0.1 (modf 12.5) => 0.5 and 12.0 (frexp 3.14) => 0.785 and 2 (ldexp 0.785 2) => 3.14 |
Since Gauche doesn't support general rational numbers,
the result of inexact->exact is always a whole number.
If the passed number is not an integer, the fraction part is
rounded. Note that it is an implementation dependent behavior.
If you want to get a closest exact integer of the given inexact
real number, it's better to use round explicitly before
inexact->exact.
If you pass an inexact number to exact->inexact or
an exact number to inexact->exact, Gauche returns
the argument as is, instead of reporting an error.
This is also an implementation dependent behavior and
you shouldn't count on that.
Number->string takes a number z and returns a string.
If z is not an exact integer, radix must be 10.
For the numbers with radix more than 10, lower case alphabet
character is used for digits, unless the optional argument
use-upper? is true, in that case upper case characters are used.
The argument use-upper? is Gauche's extension.
String->number takes a string string and parses it
as a number in radix radix system. If the number looks like
non-exact number, only radix 10 is allowed. If the given string
can't be a number, #f is returned.
x->integer uses
round and inexact->exact to obtain an integer.
Other class may provide a method to customize the behavior.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |