ftp.nice.ch/pub/next/developer/languages/lisp/AKCL.1.599.s.tar.gz#/akcl-1-599/V/c/num_co.c

This is num_co.c in view mode; [Download] [Up]

Changes file for /usr/local/src/kcl/./c/num_co.c
Created on Mon Feb  4 23:21:54 1991
Usage \n@s[Original text\n@s|Replacement Text\n@s]
See the file rascal.ics.utexas.edu:/usr2/ftp/merge.c
for a program to merge change files.  Anything not between
"\n@s[" and  "\n@s]" is a simply a comment.
This file was constructed using emacs and  merge.el
Enhancements Copyright (c) W. Schelter All rights reserved.
   by (Bill Schelter)  wfs@carl.ma.utexas.edu 


****Change:(orig (13 13 a))
@s[	that know the representation of floating-point numbers.
*/	

@s|	that know the representation of floating-point numbers.
*/	
#define IN_NUM_CO

@s]


****Change:(orig (16 16 a))
@s[#include "num_include.h"

@s|#include "num_include.h"
#include "mp.h"

@s]


****Change:(orig (19 19 a))
@s[object plus_half, minus_half;


@s|object plus_half, minus_half;

#ifdef CONVEX
#define VAX
#endif

@s]


****Change:(orig (92 93 c))
@s[	h = *(int *)(&d);
	l = *((int *)(&d) + 1);

@s|	h = *((int *)(&d) + HIND);
	l = *((int *)(&d) + LIND);

@s]


****Change:(orig (98 98 a))
@s[	l = ((l >> 16) & 0xffff) | (l << 16);

@s|	l = ((l >> 16) & 0xffff) | (l << 16);
	/* is this right!!!! I don't believe it --wfs */
	h = h >> 1;

@s]


****Change:(orig (100 104 d))
@s[#endif
#ifdef IBMRT



#endif

@s|#endif

@s]


****Change:(orig (107 107 c))
@s[	h = (h & 0x000fffff | 0x00100000) << 1;

@s|	h = (h & 0x000fffff | 0x00100000);

@s]


****Change:(orig (109 112 d))
@s[#endif
#ifdef MV


#endif

@s|#endif

@s]


****Change:(orig (115 115 c))
@s[	h = (h & 0x00ffffff) << 1;

@s|	h = (h & 0x00ffffff);

@s]


****Change:(orig (117 120 c))
@s[	if (l < 0) {
		h++;
		l &= 0x7fffffff;
	}

@s|	if (32-BIG_RADIX)
	  /* shift for making bignum */
	  { h = h << (32-BIG_RADIX) ; 
	    h |= ((l & (-1 << (32-BIG_RADIX))) >> (32-BIG_RADIX));
	    l &=  ~(-1 << (32-BIG_RADIX));
	  }

@s]


****Change:(orig (219 219 c))
@s[	return(((*(int *)(&d) & 0x7ff00000) >> 20) - 1022);

@s|	return((((*((int *)(&d) + HIND)) & 0x7ff00000) >> 20) - 1022);

@s]


****Change:(orig (239 239 c))
@s[		return(0.0);
	*(int *)(&d)

@s|		return(0.0);
	*((int *)(&d) + HIND)

@s]


****Change:(orig (250 250 c))
@s[	= *(int *)(&d) & 0x800fffff | ((e + 1022) << 20) & 0x7ff00000;

@s|	= *((int *)(&d) + HIND) & 0x800fffff | ((e + 1022) << 20) & 0x7ff00000;

@s]


****Change:(orig (277 278 c))
@s[	if (e <= -31) {
		h >>= (-e) - 31;

@s|	if (e <= -BIG_RADIX) {
		h >>= (-e) - BIG_RADIX;

@s]


****Change:(orig (285 287 c))
@s[	if (e <= -31) {
		e = (-e) - 31;
		if (e >= 31)

@s|	if (e <= -BIG_RADIX) {
		e = (-e) - BIG_RADIX;
		if (e >= BIG_RADIX)

@s]


****Change:(orig (297 297 c))
@s[	if (e <= -8) {
		h >>= 4*(-e) - 31;

@s|	if (e <= -8) {
		h >>= 4*(-e) - BIG_RADIX;

@s]


****Change:(orig (341 341 a))
@s[	vs_pop;
	return(z);
}


@s|	vs_pop;
	return(z);
}

/* Coerce X to single-float if one arg,
   otherwise coerce to same float type as second arg */

@s]


****Change:(orig (362 363 c))
@s[		if (narg > 1 && t == t_longfloat)
			x = make_longfloat((double)(fix(x)));

@s|		if (narg > 1 && t == t_shortfloat)
		  x = make_shortfloat((shortfloat)(fix(x)));

@s]


****Change:(orig (365 365 c))
@s[			x = make_shortfloat((shortfloat)(fix(x)));

@s|		  x = make_longfloat((double)(fix(x)));

@s]


****Change:(orig (371 372 c))
@s[		if (narg > 1 && t == t_longfloat)
			x = make_longfloat(d);

@s|		if (narg > 1 && t == t_shortfloat)
		  x = make_shortfloat((shortfloat)d);

@s]


****Change:(orig (374 374 c))
@s[			x = make_shortfloat((shortfloat)d);

@s|		  x = make_longfloat(d);		

@s]


****Change:(orig (378 379 c))
@s[		if (narg > 1 && t == t_longfloat)
			x = make_longfloat((double)(sf(x)));

@s|		if (narg > 1 && t == t_shortfloat);
		  else
		    x = make_longfloat((double)(sf(x)));

@s]


****Change:(orig (521 521 c))
@s[		if (number_minusp(q1) && number_compare(q, q1)) {

@s|		if (number_minusp(q) && number_compare(q, q1)) {

@s]


****Change:(orig (642 642 c))
@s[		if (number_plusp(q1) && number_compare(q, q1)) {

@s|		if (number_plusp(q) && number_compare(q, q1)) {

@s]


****Change:(orig (1021 1021 c))
@s[		vs_base[0] = small_fixnum(6);

@s|		vs_base[0] = small_fixnum(24);

@s]


****Change:(orig (1023 1023 c))
@s[		vs_base[0] = small_fixnum(14);

@s|		vs_base[0] = small_fixnum(53);

@s]


****Change:(orig (1037 1037 c))
@s[			vs_base[0] = small_fixnum(6);

@s|			vs_base[0] = small_fixnum(24);

@s]


****Change:(orig (1043 1043 c))
@s[			vs_base[0] = small_fixnum(14);

@s|			vs_base[0] = small_fixnum(53);

@s]


****Change:(orig (1049 1049 c))
@s[			vs_base[0] = small_fixnum(13);

@s|			vs_base[0] = small_fixnum(53);

@s]


****Change:(orig (1055 1055 c))
@s[			vs_base[0] = small_fixnum(14);

@s|			vs_base[0] = small_fixnum(53);

@s]


****Change:(orig (1141 1141 a))
@s[		vs_base[0] = x->cmp.cmp_imag;
		break;
	}
}


@s|		vs_base[0] = x->cmp.cmp_imag;
		break;
	}
}

static float sf1,sf2;
static sf_eql()
{return(sf1==sf2);}

static lf_eql(a,b)
     double a,b;
{return(a==b);}
#define LF_EQL(a,b) lf_eql((double)(a),(double)(b))
#define SF_EQL(a,b) (sf1=a,sf2=b,sf_eql())


@s]


****Change:(orig (1157 1163 d))
@s[#ifdef IBMRT




#endif

@s,

@s|
@s]


****Change:(orig (1172 1176 c))
@s[	l[0] = 1;
	smallest_float = *(float *)l;
	l[0] = 0;
	l[1] = 1;

@s,	smallest_double = *(double *)l;

@s|
	((int *) &smallest_float)[0]= 1;
	((int *) &smallest_double)[HIND] = 0;
	((int *) &smallest_double)[LIND] = 1;


@s]


****Change:(orig (1216 1220 c))
@s[	l[0] = 0x7f7fffff;
	biggest_float = *(float *)l;
	l[0] = 0x7fefffff;
	l[1] = 0xffffffff;

@s,	biggest_double = *(double *)l;

@s|
	((int *) &biggest_float)[0]= 0x7f7fffff;
	((int *) &biggest_double)[HIND] = 0x7fefffff;
	((int *) &biggest_double)[LIND] = 0xffffffff;

#ifdef BAD_FPCHIP
 /* &&&& I am adding junk values to get past debugging */
        biggest_float = 1.0e37;
        smallest_float = 1.0e-37;
        biggest_double = 1.0e308;
        smallest_double = 1.0e-308;
        printf("\n Used fake values for float max and mins ");

@s]


****Change:(orig (1222 1222 a))
@s[#endif
#endif

@s|#endif
#endif
#endif

@s]


****Change:(orig (1251 1251 c))
@s[


#endif

#ifdef S3000

@s|


#endif

#if defined(S3000) && ~defined(DBL_MAX_10_EXP)

@s]


****Change:(orig (1277 1277 a))
@s[	biggest_double = *(double *)l;
#endif


@s|	biggest_double = *(double *)l;
#endif

	
#ifdef DBL_MAX_10_EXP
	biggest_double = DBL_MAX;
	smallest_double = DBL_MIN;
	smallest_float = FLT_MIN;
	biggest_float = FLT_MAX;
#endif
	



/* We want the smallest number not satisfying something,
   and so we go quickly down, and then back up.  We have
   to use a function call for test, since in line code may keep
   too much precision, while the usual lisp eql,is not
   in line.
   We use SMALL as a multiple to come back up by.
*/

#define SMALL 1.05	

@s]


****Change:(orig (1279 1279 c))
@s[	     (float)(1.0 + float_epsilon) != (float)1.0;

@s|	     !SF_EQL((float)(1.0 + float_epsilon),(float)1.0);

@s]


****Change:(orig (1281 1281 a))
@s[	     float_epsilon /= 2.0)
		;

@s|	     float_epsilon /= 2.0)
		;
	while(SF_EQL((float)(1.0 + float_epsilon),(float)1.0))
	  float_epsilon=float_epsilon*SMALL;

@s]


****Change:(orig (1283 1283 c))
@s[	     (float)(1.0 - float_negative_epsilon) != (float)1.0;

@s|	     !SF_EQL((float)(1.0 - float_negative_epsilon) ,(float)1.0);

@s]


****Change:(orig (1285 1285 a))
@s[	     float_negative_epsilon /= 2.0)
		;

@s|	     float_negative_epsilon /= 2.0)
		;
	while(SF_EQL((float)(1.0 - float_negative_epsilon) ,(float)1.0))
	  float_negative_epsilon=float_negative_epsilon*SMALL;

@s]


****Change:(orig (1287 1287 c))
@s[	     1.0 + double_epsilon != 1.0;

@s|	     !(LF_EQL(1.0 + double_epsilon, 1.0));

@s]


****Change:(orig (1289 1289 a))
@s[	     double_epsilon /= 2.0)
		;

@s|	     double_epsilon /= 2.0)
		;
	while((LF_EQL(1.0 + double_epsilon, 1.0)))
	  double_epsilon=double_epsilon*SMALL;
	  ;

@s]


****Change:(orig (1291 1291 c))
@s[	     1.0 - double_negative_epsilon != 1.0;

@s|	     !LF_EQL(1.0 - double_negative_epsilon , 1.0);

@s]


****Change:(orig (1293 1293 a))
@s[	     double_negative_epsilon /= 2.0)
		;

@s|	     double_negative_epsilon /= 2.0)
		;
	while(LF_EQL(1.0 - double_negative_epsilon , 1.0))
	  double_negative_epsilon=double_negative_epsilon*SMALL;
	  ;
	

@s]

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.