[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-developer] function MANEXP missing in sf.spad
From: |
Arthur Norman |
Subject: |
Re: [Axiom-developer] function MANEXP missing in sf.spad |
Date: |
Sat, 4 Oct 2003 23:21:53 +0100 (GMT Daylight Time) |
On Sat, 4 Oct 2003, Weiss, Juergen wrote:
> Seems that the lisp function MANEXP is missing
> in gcl and cmu lisp. The function is called
> from sf.spad function manexp. It seems that
> integer-decode-float is almost a replacement
> for manexp. Is there any documentation what
> manexp or MANEXP is supposed to do?
>
> Juergen Weiss
>
The code I ended up with was
static Lisp_Object Lmanexp(Lisp_Object nil, Lisp_Object a)
{
int x;
double f;
if (! is_float(a)) aerror1("arg is not a floating-point number", a);
f = float_of_number(a);
f = frexp(f, &x);
errexit();
return onevalue(cons(make_boxfloat(f,TYPE_DOUBLE_FLOAT),
fixnum_of_int(x)));
}
Ie it expects a float, splits into integer and fraction part and returns a
cons of the fraction as a double-precision number and the integer part as
an integer. My implementation only supports values wheer the integer part
is small enough to be a fixnum, and does what C does wrt "fractional
part". Right now I do not recall exactly where the spec came from but that
was what went into CSL to support the NAG effort on Axiom.
Arthur