mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-14 21:32:49 -08:00
Use make_{short/long}float to ensure that floating-point exceptions are detected
This commit is contained in:
parent
4e81043908
commit
a6e722ee50
1 changed files with 5 additions and 9 deletions
|
|
@ -32,21 +32,17 @@ rando(cl_object x, cl_object rs)
|
|||
d = number_to_double(x) * d;
|
||||
if (tx == t_fixnum) {
|
||||
z = MAKE_FIXNUM((cl_fixnum)d);
|
||||
return(z);
|
||||
} else if (tx == t_bignum) {
|
||||
z = double_to_integer(d);
|
||||
return(z);
|
||||
} else if (tx == t_shortfloat) {
|
||||
z = cl_alloc_object(t_shortfloat);
|
||||
sf(z) = (float)d;
|
||||
return(z);
|
||||
z = make_shortfloat((float)d);
|
||||
} else if (tx == t_longfloat) {
|
||||
z = cl_alloc_object(t_longfloat);
|
||||
lf(z) = d;
|
||||
return(z);
|
||||
} else
|
||||
z = make_longfloat(d);
|
||||
} else {
|
||||
FEerror("~S is not an integer nor a floating-point number.",
|
||||
1, x);
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
cl_object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue