shithub: femtolisp

ref: e0508d01357b9062eabac8c7fe4cdb6ea7c57fc8
dir: /3rd/mp/test/main.c/

View raw version
#include "platform.h"
#include "mp.h"
#include "dat.h"
#include "fns.h"
#include "ieee754.h"

double D_PNAN, D_NNAN, D_PINF, D_NINF;
float F_PNAN, F_NNAN, F_PINF, F_NINF;
int anyfail = 0;

void
prng(uint8_t *p, int n)
{
	while(n-- > 0)
		*p++ = rand();
}

int
main()
{
	D_PNAN = D_NNAN = strtod("+NaN", nil);
	D_PINF = D_NINF = strtod("+Inf", nil);

	union ieee754_double *d;
	d = (union ieee754_double *)&D_NNAN;
	d->ieee.negative = 1;
	d = (union ieee754_double *)&D_NINF;
	d->ieee.negative = 1;

	convtests();
	tests();
	return anyfail;
}