2
Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
4
This file is part of GNU Common Lisp, herein referred to as GCL
6
GCL is free software; you can redistribute it and/or modify it under
7
the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
8
the Free Software Foundation; either version 2, or (at your option)
11
GCL is distributed in the hope that it will be useful, but WITHOUT
12
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14
License for more details.
16
You should have received a copy of the GNU Library General Public License
17
along with GCL; see the file COPYING. If not, write to the Free Software
18
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24
IMPLEMENTATION-DEPENDENT
26
This file contains those functions
27
that know the representation of floating-point numbers.
35
#include "num_include.h"
37
object plus_half, minus_half;
38
extern void zero_divisor(void);
43
/* A number is normal when:
46
* its exponent is non-zero.
49
gcl_isnormal_double(double d) {
51
union {double d;int i[2];} u;
53
if (!ISFINITE(d) || !d)
58
return (u.i[HIND] & 0x7ff00000) != 0;
60
#error gcl_isnormal_double only implemented for IEEE
65
int gcl_isnormal_float(float f)
67
union {float f;int i;} u;
69
if (!ISFINITE(f) || !f)
74
return (u.i & 0x7f800000) != 0;
76
#error gcl_isnormal_float only implemented for IEEE
85
SEEEEEEEEHHHHHHH The redundant most significant fraction bit
86
HHHHHHHHHHHHHHHH is not expressed.
114
SEEEEEEEEEEEHHHHHHHHHHHHHHHHHHHH The redundant most
115
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL significant fraction bit
132
SEEEEEEEHHHHHHHHHHHHHHHHHHHHHHHH
133
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
137
integer_decode_double(double d, int *hp, int *lp, int *ep, int *sp)
140
union {double d;int i[2];} u;
155
/* h = *((int *)(&d) + HIND); */
156
/* l = *((int *)(&d) + LIND); */
159
*ep = ((h >> 7) & 0xff) - 128 - 56;
160
h = ((h >> 15) & 0x1fffe) | (((h & 0x7f) | 0x80) << 17);
161
l = ((l >> 16) & 0xffff) | (l << 16);
162
/* is this right!!!! I don't believe it --wfs */
167
*ep = ((h & 0x7ff00000) >> 20) - 1022 - 53;
168
h = ((h & 0x000fffff) | 0x00100000);
170
*ep = ((h & 0x7fe00000) >> 20) - 1022 - 53 + 1;
171
h = (h & 0x001fffff);
175
*ep = ((h & 0x7f000000) >> 24) - 64 - 14;
176
h = (h & 0x00ffffff);
179
/* shift for making bignum */
180
{ h = h << (32-BIG_RADIX) ;
181
h |= ((l & (-1 << (32-BIG_RADIX))) >> (32-BIG_RADIX));
182
l &= ~(-1 << (32-BIG_RADIX));
186
*sp = (d > 0.0 ? 1 : -1);
193
SEEEEEEEEMMMMMMM The redundant most significant fraction bit
194
MMMMMMMMMMMMMMMM is not expressed.
209
SEEEEEEEEMMMMMMMMMMMMMMMMMMMMMMM The redundant most
210
significant fraction bit
225
SEEEEEEEMMMMMMMMMMMMMMMMMMMMMMMM
229
integer_decode_float(double d, int *mp, int *ep, int *sp)
233
union {float f;int i;} u;
244
/* m = *(int *)(&f); */
246
*ep = ((m >> 7) & 0xff) - 128 - 24;
247
*mp = ((m >> 16) & 0xffff) | (((m & 0x7f) | 0x80) << 16);
255
*ep = ((m & 0x7f800000) >> 23) - 126 - 24;
256
*mp = (m & 0x007fffff) | 0x00800000;
258
*ep = ((m & 0x7f000000) >> 23) - 126 - 24 + 1;
259
*mp = m & 0x00ffffff;
267
*ep = ((m & 0x7f000000) >> 24) - 64 - 6;
268
*mp = m & 0x00ffffff;
270
*sp = (f > 0.0 ? 1 : -1);
274
double_exponent(double d)
276
union {double d;int i[2];} u;
281
return(((*(int *)(&d) >> 7) & 0xff) - 128);
291
return (((u.i[HIND] & 0x7ff00000) >> 20) - 1022);
298
return(((*(int *)(&d) & 0x7f000000) >> 24) - 64);
303
set_exponent(double d, int e)
305
union {double d;int i[2];} u;
313
= *(int *)(&d) & 0xffff807f | ((e + 128) << 7) & 0x7f80;
322
= (u.i[HIND] & 0x800fffff) | (((e + 1022) << 20) & 0x7ff00000);
329
= *(int *)(&d) & 0x80ffffff | ((e + 64) << 24) & 0x7f000000;
336
double_to_integer(double d)
340
object shift_integer(object x, int w);
344
return(small_fixnum(0));
345
integer_decode_double(d, &h, &l, &e, &s);
347
if (e <= -BIG_RADIX) {
348
h >>= (-e) - BIG_RADIX;
355
if (e <= -BIG_RADIX) {
356
e = (-e) - BIG_RADIX;
358
return(small_fixnum(0));
367
h >>= 4*(-e) - BIG_RADIX;
369
return(make_fixnum(s*h));
377
x = shift_integer(x, e);
383
x = shift_integer(x, e);
389
x = shift_integer(x, 4*e);
393
x = number_negate(x);
400
num_remainder(object x, object y, object q)
404
z = number_times(q, y);
406
z = number_minus(x, z);
411
/* Coerce X to single-float if one arg,
412
otherwise coerce to same float type as second arg */
421
narg = vs_top - vs_base;
425
too_many_arguments();
427
check_type_float(&vs_base[1]);
428
t = type_of(vs_base[1]);
431
switch (type_of(x)) {
433
if (narg > 1 && t == t_shortfloat)
434
x = make_shortfloat((shortfloat)(fix(x)));
436
x = make_longfloat((double)(fix(x)));
441
d = number_to_double(x);
442
if (narg > 1 && t == t_shortfloat)
443
x = make_shortfloat((shortfloat)d);
445
x = make_longfloat(d);
449
if (narg > 1 && t == t_shortfloat);
451
x = make_longfloat((double)(sf(x)));
455
if (narg > 1 && t == t_shortfloat)
456
x = make_shortfloat((shortfloat)(lf(x)));
460
FEwrong_type_argument(TSor_rational_float, x);
466
LFD(Lnumerator)(void)
469
check_type_rational(&vs_base[0]);
470
if (type_of(vs_base[0]) == t_ratio)
471
vs_base[0] = vs_base[0]->rat.rat_num;
474
LFD(Ldenominator)(void)
477
check_type_rational(&vs_base[0]);
478
if (type_of(vs_base[0]) == t_ratio)
479
vs_base[0] = vs_base[0]->rat.rat_den;
481
vs_base[0] = small_fixnum(1);
489
object one_minus(object x);
491
n = vs_top - vs_base;
497
switch (type_of(x)) {
501
vs_push(small_fixnum(0));
511
q1 = double_to_integer(d);
512
d -= number_to_double(q1);
513
if (sf(x) < 0.0 && d != 0.0) {
520
vs_push(make_shortfloat((shortfloat)d));
525
q1 = double_to_integer(d);
526
d -= number_to_double(q1);
527
if (lf(x) < 0.0 && d != 0.0) {
534
vs_push(make_longfloat(d));
538
FEwrong_type_argument(TSor_rational_float, x);
543
too_many_arguments();
546
if ( number_zerop ( y ) == TRUE ) {
549
if ((type_of(x) == t_fixnum || type_of(x) == t_bignum) &&
550
(type_of(y) == t_fixnum || type_of(y) == t_bignum)) {
552
if (number_zerop(x)) {
553
vs_push(small_fixnum(0));
554
vs_push(small_fixnum(0));
559
integer_quotient_remainder_1(x, y, &vs_base[0], &vs_base[1]);
560
if (number_minusp(x) ? number_plusp(y) : number_minusp(y)) {
561
if (number_zerop(vs_base[1]))
563
vs_base[0] = one_minus(vs_base[0]);
564
vs_base[1] = number_plus(vs_base[1], y);
568
check_type_or_rational_float(&vs_base[0]);
569
check_type_or_rational_float(&vs_base[1]);
570
q = number_divide(x, y);
572
switch (type_of(q)) {
577
vs_push(small_fixnum(0));
582
q1 = integer_divide1(q->rat.rat_num, q->rat.rat_den);
583
if (number_minusp(q)) {
590
vs_push(num_remainder(x, y, q1));
595
q1 = double_to_integer(number_to_double(q));
596
if (number_minusp(q) && number_compare(q, q1)) {
603
vs_push(num_remainder(x, y, q1));
615
object one_plus(object x);
617
n = vs_top - vs_base;
623
switch (type_of(x)) {
627
vs_push(small_fixnum(0));
637
q1 = double_to_integer(d);
638
d -= number_to_double(q1);
639
if (sf(x) > 0.0 && d != 0.0) {
646
vs_push(make_shortfloat((shortfloat)d));
651
q1 = double_to_integer(d);
652
d -= number_to_double(q1);
653
if (lf(x) > 0.0 && d != 0.0) {
660
vs_push(make_longfloat(d));
664
FEwrong_type_argument(TSor_rational_float, x);
669
too_many_arguments();
672
if ( number_zerop ( y ) == TRUE ) {
675
if ((type_of(x) == t_fixnum || type_of(x) == t_bignum) &&
676
(type_of(y) == t_fixnum || type_of(y) == t_bignum)) {
678
if (number_zerop(x)) {
679
vs_push(small_fixnum(0));
680
vs_push(small_fixnum(0));
685
integer_quotient_remainder_1(x, y, &vs_base[0], &vs_base[1]);
686
if (number_plusp(x) ? number_plusp(y) : number_minusp(y)) {
687
if (number_zerop(vs_base[1]))
689
vs_base[0] = one_plus(vs_base[0]);
690
vs_base[1] = number_minus(vs_base[1], y);
694
check_type_or_rational_float(&vs_base[0]);
695
check_type_or_rational_float(&vs_base[1]);
696
q = number_divide(x, y);
698
switch (type_of(q)) {
703
vs_push(small_fixnum(0));
708
q1 = integer_divide1(q->rat.rat_num, q->rat.rat_den);
709
if (number_plusp(q)) {
716
vs_push(num_remainder(x, y, q1));
721
q1 = double_to_integer(number_to_double(q));
722
if (number_plusp(q) && number_compare(q, q1)) {
729
vs_push(num_remainder(x, y, q1));
741
n = vs_top - vs_base;
747
switch (type_of(x)) {
751
vs_push(small_fixnum(0));
755
q1 = integer_divide1(x->rat.rat_num, x->rat.rat_den);
758
vs_push(number_minus(x, q1));
762
q1 = double_to_integer((double)(sf(x)));
765
vs_push(number_minus(x, q1));
769
q1 = double_to_integer(lf(x));
772
vs_push(number_minus(x, q1));
776
FEwrong_type_argument(TSor_rational_float, x);
781
too_many_arguments();
784
if ( number_zerop ( y ) == TRUE ) {
787
if ((type_of(x) == t_fixnum || type_of(x) == t_bignum) &&
788
(type_of(y) == t_fixnum || type_of(y) == t_bignum)) {
789
integer_quotient_remainder_1(x, y, &vs_base[0], &vs_base[1]);
792
check_type_or_rational_float(&vs_base[0]);
793
check_type_or_rational_float(&vs_base[1]);
794
q = number_divide(x, y);
796
switch (type_of(q)) {
801
vs_push(small_fixnum(0));
805
q1 = integer_divide1(q->rat.rat_num, q->rat.rat_den);
808
vs_push(num_remainder(x, y, q1));
813
q1 = double_to_integer(number_to_double(q));
816
vs_push(num_remainder(x, y, q1));
825
object x, y, q, q1, r;
828
object one_plus(object x), one_minus(object x);
830
n = vs_top - vs_base;
836
switch (type_of(x)) {
840
vs_push(small_fixnum(0));
851
q = double_to_integer(d + 0.5);
853
q = double_to_integer(d - 0.5);
854
d -= number_to_double(q);
855
if (d == 0.5 && number_oddp(q)) {
860
if (d == -0.5 && number_oddp(q)) {
867
vs_push(make_shortfloat((shortfloat)d));
873
q = double_to_integer(d + 0.5);
875
q = double_to_integer(d - 0.5);
876
d -= number_to_double(q);
877
if (d == 0.5 && number_oddp(q)) {
882
if (d == -0.5 && number_oddp(q)) {
889
vs_push(make_longfloat(d));
893
FEwrong_type_argument(TSor_rational_float, x);
898
too_many_arguments();
901
check_type_or_rational_float(&vs_base[0]);
902
check_type_or_rational_float(&vs_base[1]);
903
q = number_divide(x, y);
905
switch (type_of(q)) {
910
vs_push(small_fixnum(0));
915
q1 = integer_divide1(q->rat.rat_num, q->rat.rat_den);
917
r = number_minus(q, q1);
919
if ((c = number_compare(r, plus_half)) > 0 ||
920
(c == 0 && number_oddp(q1)))
922
if ((c = number_compare(r, minus_half)) < 0 ||
923
(c == 0 && number_oddp(q1)))
927
vs_push(num_remainder(x, y, q1));
932
d = number_to_double(q);
934
q1 = double_to_integer(d + 0.5);
936
q1 = double_to_integer(d - 0.5);
937
d -= number_to_double(q1);
938
if (d == 0.5 && number_oddp(q1)) {
942
if (d == -0.5 && number_oddp(q1)) {
948
vs_push(num_remainder(x, y, q1));
970
LFD(Ldecode_float)(void)
977
check_type_float(&vs_base[0]);
979
if (type_of(x) == t_shortfloat)
993
integer_decode_double(d,&hp,&lp,&e,&sp);
995
d=number_to_double(bignum2(hp, lp));
999
e += double_exponent(d);
1000
d = set_exponent(d, 0);
1002
if (type_of(x) == t_shortfloat) {
1003
vs_push(make_shortfloat((shortfloat)d));
1004
vs_push(make_fixnum(e));
1005
vs_push(make_shortfloat((shortfloat)s));
1007
vs_push(make_longfloat(d));
1008
vs_push(make_fixnum(e));
1009
vs_push(make_longfloat((double)s));
1013
LFD(Lscale_float)(void)
1020
check_type_float(&vs_base[0]);
1022
if (type_of(vs_base[1]) == t_fixnum)
1023
k = fix(vs_base[1]);
1025
FEerror("~S is an illegal exponent.", 1, vs_base[1]);
1026
if (type_of(x) == t_shortfloat)
1030
e = double_exponent(d) + k;
1032
if (e <= -128 || e >= 128)
1038
/* Upper bound not needed, handled by floating point overflow */
1039
/* this checks if we're in the denormalized range */
1040
if (!ISNORMAL(d) || (type_of(x) == t_shortfloat && e <= -126/* || e >= 130 */) ||
1041
(type_of(x) == t_longfloat && (e <= -1022 /* || e >= 1026 */)))
1047
if (e < -64 || e >= 64)
1049
/* FEerror("~S is an illegal exponent.", 1, vs_base[1]); */
1051
for (;k>0;d*=2.0,k--);
1052
for (;k<0;d*=0.5,k++);
1055
d = set_exponent(d, e);
1057
if (type_of(x) == t_shortfloat)
1058
vs_base[0] = make_shortfloat((shortfloat)d);
1060
vs_base[0] = make_longfloat(d);
1063
LFD(Lfloat_radix)(void)
1066
check_type_float(&vs_base[0]);
1068
vs_base[0] = small_fixnum(2);
1074
vs_base[0] = small_fixnum(2);
1080
vs_base[0] = small_fixnum(16);
1084
LFD(Lfloat_sign)(void)
1090
narg = vs_top - vs_base;
1092
too_few_arguments();
1094
too_many_arguments();
1095
check_type_float(&vs_base[0]);
1097
if (type_of(x) == t_shortfloat)
1104
check_type_float(&vs_base[1]);
1106
if (type_of(x) == t_shortfloat)
1116
if (type_of(x) == t_shortfloat)
1117
vs_push(make_shortfloat((shortfloat)f));
1119
vs_push(make_longfloat(f));
1122
LFD(Lfloat_digits)(void)
1125
check_type_float(&vs_base[0]);
1126
if (type_of(vs_base[0]) == t_shortfloat)
1127
vs_base[0] = small_fixnum(24);
1129
vs_base[0] = small_fixnum(53);
1132
LFD(Lfloat_precision)(void)
1137
check_type_float(&vs_base[0]);
1139
if (type_of(x) == t_shortfloat)
1141
vs_base[0] = small_fixnum(0);
1143
vs_base[0] = small_fixnum(24);
1146
vs_base[0] = small_fixnum(0);
1149
vs_base[0] = small_fixnum(53);
1155
vs_base[0] = small_fixnum(53);
1161
vs_base[0] = small_fixnum(53);
1165
LFD(Linteger_decode_float)(void)
1171
check_type_float(&vs_base[0]);
1174
if (type_of(x) == t_longfloat) {
1175
integer_decode_double(lf(x), &h, &l, &e, &s);
1177
vs_push(bignum2(h, l));
1179
vs_push(make_fixnum(l));
1180
vs_push(make_fixnum(e));
1181
vs_push(make_fixnum(s));
1183
integer_decode_float((double)(sf(x)), &h, &e, &s);
1184
vs_push(make_fixnum(h));
1185
vs_push(make_fixnum(e));
1186
vs_push(make_fixnum(s));
1195
narg = vs_top - vs_base;
1197
too_few_arguments();
1199
too_many_arguments();
1200
check_type_or_rational_float(&vs_base[0]);
1203
i = small_fixnum(0);
1205
check_type_or_rational_float(&vs_base[1]);
1209
vs_push(make_complex(r, i));
1212
LFD(Lrealpart)(void)
1217
check_type_number(&vs_base[0]);
1219
if (type_of(x) == t_complex)
1220
vs_base[0] = x->cmp.cmp_real;
1223
LFD(Limagpart)(void)
1228
check_type_number(&vs_base[0]);
1230
switch (type_of(x)) {
1234
vs_base[0] = small_fixnum(0);
1237
vs_base[0] = shortfloat_zero;
1240
vs_base[0] = longfloat_zero;
1243
vs_base[0] = x->cmp.cmp_imag;
1251
gcl_init_num_co(void)
1253
float smallest_float, smallest_norm_float, biggest_float;
1254
double smallest_double, smallest_norm_double, biggest_double;
1255
float float_epsilon, float_negative_epsilon;
1256
double double_epsilon, double_negative_epsilon;
1257
union {double d;int i[2];} u;
1258
union {float f;int i;} uf;
1264
smallest_float = *(float *)l;
1265
smallest_double = *(double *)l;
1279
smallest_float=uf.f;
1280
smallest_double=u.d;
1282
/* ((int *) &smallest_float)[0]= 1; */
1283
/* ((int *) &smallest_double)[HIND] = 0; */
1284
/* ((int *) &smallest_double)[LIND] = 1; */
1299
smallest_float = *(float *)l;
1300
smallest_double = *(double *)l;
1306
biggest_float = *(float *)l;
1307
biggest_double = *(double *)l;
1327
u.i[HIND]=0x7fefffff;
1328
u.i[LIND]=0xffffffff;
1333
/* ((int *) &biggest_float)[0]= 0x7f7fffff; */
1334
/* ((int *) &biggest_double)[HIND] = 0x7fefffff; */
1335
/* ((int *) &biggest_double)[LIND] = 0xffffffff; */
1338
/* &&&& I am adding junk values to get past debugging */
1339
biggest_float = 1.0e37;
1340
smallest_float = 1.0e-37;
1341
biggest_double = 1.0e308;
1342
smallest_double = 1.0e-308;
1343
printf("\n Used fake values for float max and mins ");
1348
#if defined(S3000) && ~defined(DBL_MAX_10_EXP)
1353
biggest_float = *(float *)l;
1354
biggest_float = *(float *)l;
1355
biggest_float = *(float *)l;
1356
biggest_float = 0.0;
1357
biggest_float = biggest_float + 1.0;
1358
biggest_float = biggest_float + 2.0;
1359
biggest_float = *(float *)l;
1360
biggest_float = *(float *)l;
1361
strcmp("I don't like", "DATA GENERAL.");
1362
biggest_float = *(float *)l;
1363
biggest_double = *(double *)l;
1364
biggest_double = *(double *)l;
1365
biggest_double = *(double *)l;
1366
biggest_double = 0.0;
1367
biggest_double = biggest_double + 1.0;
1368
biggest_double = biggest_double + 2.0;
1369
biggest_double = *(double *)l;
1370
biggest_double = *(double *)l;
1371
strcmp("I don't like", "DATA GENERAL.");
1372
biggest_double = *(double *)l;
1376
#ifdef DBL_MAX_10_EXP
1377
biggest_double = DBL_MAX;
1378
smallest_norm_double = DBL_MIN;
1379
smallest_norm_float = FLT_MIN;
1380
biggest_float = FLT_MAX;
1385
volatile double rd,dd,td,td1;
1386
volatile float rf,df,tf,tf1;
1390
for (rf=1.0f,df=0.5f,i=j=0;i<MAX && j<MAX && df!=1.0f;i++,df=1.0f-(0.5f*(1.0f-df)))
1391
for (tf=rf,tf1=tf+1.0f,j=0;j<MAX && tf1!=1.0f;j++,rf=tf,tf*=df,tf1=tf+1.0f);
1393
printf("WARNING, cannot calculate float_epsilon: %d %d %f %f %f %f\n",i,j,rf,df,tf,tf1);
1396
for (rf=1.0f,df=0.5f,i=j=0;i<MAX && j<MAX && df!=1.0f;i++,df=1.0f-(0.5f*(1.0f-df)))
1397
for (tf=rf,tf1=1.0f-tf,j=0;j<MAX && tf1!=1.0f;j++,rf=tf,tf*=df,tf1=1.0f-tf);
1399
printf("WARNING, cannot calculate float_negative_epsilon: %d %d %f %f %f %f\n",i,j,rf,df,tf,tf1);
1400
float_negative_epsilon=rf;
1402
for (rd=1.0,dd=0.5,i=j=0;i<MAX && j<MAX && dd!=1.0;i++,dd=1.0-(0.5*(1.0-dd)))
1403
for (td=rd,td1=td+1.0,j=0;j<MAX && td1!=1.0;j++,rd=td,td*=dd,td1=td+1.0);
1405
printf("WARNING, cannot calculate double_epsilon: %d %d %f %f %f %f\n",i,j,rd,dd,td,td1);
1408
for (rd=1.0,dd=0.5,i=j=0;i<MAX && j<MAX && dd!=1.0;i++,dd=1.0-(0.5*(1.0-dd)))
1409
for (td=rd,td1=1.0-td,j=0;j<MAX && td1!=1.0;j++,rd=td,td*=dd,td1=1.0-td);
1411
printf("WARNING, cannot calculate double_negative_epsilon: %d %d %f %f %f %f\n",i,j,rd,dd,td,td1);
1412
double_negative_epsilon=rd;
1418
/* Maybe check for "right" answer here */
1421
make_constant("MOST-POSITIVE-SHORT-FLOAT",
1422
make_shortfloat(biggest_float));
1423
make_constant("LEAST-POSITIVE-SHORT-FLOAT",
1424
make_shortfloat(smallest_float));
1425
make_constant("LEAST-NEGATIVE-SHORT-FLOAT",
1426
make_shortfloat(-smallest_float));
1427
make_constant("MOST-NEGATIVE-SHORT-FLOAT",
1428
make_shortfloat(-biggest_float));
1430
make_constant("MOST-POSITIVE-SINGLE-FLOAT",
1431
make_longfloat(biggest_double));
1432
make_constant("LEAST-POSITIVE-SINGLE-FLOAT",
1433
make_longfloat(smallest_double));
1434
make_constant("LEAST-NEGATIVE-SINGLE-FLOAT",
1435
make_longfloat(-smallest_double));
1436
make_constant("MOST-NEGATIVE-SINGLE-FLOAT",
1437
make_longfloat(-biggest_double));
1439
make_constant("MOST-POSITIVE-DOUBLE-FLOAT",
1440
make_longfloat(biggest_double));
1441
make_constant("LEAST-POSITIVE-DOUBLE-FLOAT",
1442
make_longfloat(smallest_double));
1443
make_constant("LEAST-NEGATIVE-DOUBLE-FLOAT",
1444
make_longfloat(-smallest_double));
1445
make_constant("MOST-NEGATIVE-DOUBLE-FLOAT",
1446
make_longfloat(-biggest_double));
1448
make_constant("MOST-POSITIVE-LONG-FLOAT",
1449
make_longfloat(biggest_double));
1450
make_constant("LEAST-POSITIVE-LONG-FLOAT",
1451
make_longfloat(smallest_double));
1452
make_constant("LEAST-NEGATIVE-LONG-FLOAT",
1453
make_longfloat(-smallest_double));
1454
make_constant("MOST-NEGATIVE-LONG-FLOAT",
1455
make_longfloat(-biggest_double));
1457
make_constant("SHORT-FLOAT-EPSILON",
1458
make_shortfloat(float_epsilon));
1459
make_constant("SINGLE-FLOAT-EPSILON",
1460
make_longfloat(double_epsilon));
1461
make_constant("DOUBLE-FLOAT-EPSILON",
1462
make_longfloat(double_epsilon));
1463
make_constant("LONG-FLOAT-EPSILON",
1464
make_longfloat(double_epsilon));
1466
make_constant("SHORT-FLOAT-NEGATIVE-EPSILON",
1467
make_shortfloat(float_negative_epsilon));
1468
make_constant("SINGLE-FLOAT-NEGATIVE-EPSILON",
1469
make_longfloat(double_negative_epsilon));
1470
make_constant("DOUBLE-FLOAT-NEGATIVE-EPSILON",
1471
make_longfloat(double_negative_epsilon));
1472
make_constant("LONG-FLOAT-NEGATIVE-EPSILON",
1473
make_longfloat(double_negative_epsilon));
1475
/* Normalized constants added, CM */
1476
make_constant("LEAST-POSITIVE-NORMALIZED-SHORT-FLOAT",
1477
make_shortfloat(smallest_norm_float));
1478
make_constant("LEAST-NEGATIVE-NORMALIZED-SHORT-FLOAT",
1479
make_shortfloat(-smallest_norm_float));
1480
make_constant("LEAST-POSITIVE-NORMALIZED-SINGLE-FLOAT",
1481
make_longfloat(smallest_norm_double));
1482
make_constant("LEAST-NEGATIVE-NORMALIZED-SINGLE-FLOAT",
1483
make_longfloat(-smallest_norm_double));
1484
make_constant("LEAST-POSITIVE-NORMALIZED-DOUBLE-FLOAT",
1485
make_longfloat(smallest_norm_double));
1486
make_constant("LEAST-NEGATIVE-NORMALIZED-DOUBLE-FLOAT",
1487
make_longfloat(-smallest_norm_double));
1488
make_constant("LEAST-POSITIVE-NORMALIZED-LONG-FLOAT",
1489
make_longfloat(smallest_norm_double));
1490
make_constant("LEAST-NEGATIVE-NORMALIZED-LONG-FLOAT",
1491
make_longfloat(-smallest_norm_double));
1493
plus_half = make_ratio(small_fixnum(1), small_fixnum(2));
1494
enter_mark_origin(&plus_half);
1496
minus_half = make_ratio(small_fixnum(-1), small_fixnum(2));
1497
enter_mark_origin(&minus_half);
1499
make_function("FLOAT", Lfloat);
1500
make_function("NUMERATOR", Lnumerator);
1501
make_function("DENOMINATOR", Ldenominator);
1502
make_function("FLOOR", Lfloor);
1503
make_function("CEILING", Lceiling);
1504
make_function("TRUNCATE", Ltruncate);
1505
make_function("ROUND", Lround);
1506
make_function("MOD", Lmod);
1507
make_function("REM", Lrem);
1508
make_function("DECODE-FLOAT", Ldecode_float);
1509
make_function("SCALE-FLOAT", Lscale_float);
1510
make_function("FLOAT-RADIX", Lfloat_radix);
1511
make_function("FLOAT-SIGN", Lfloat_sign);
1512
make_function("FLOAT-DIGITS", Lfloat_digits);
1513
make_function("FLOAT-PRECISION", Lfloat_precision);
1514
make_function("INTEGER-DECODE-FLOAT", Linteger_decode_float);
1515
make_function("COMPLEX", Lcomplex);
1516
make_function("REALPART", Lrealpart);
1517
make_function("IMAGPART", Limagpart);