shithub: femtolisp

ref: 3d4b32c3af3e12ce408536464a1afa67748f9eac
dir: /llt/lltinit.c/

View raw version
#include "llt.h"

double D_PNAN, D_NNAN, D_PINF, D_NINF;
float F_PNAN, F_NNAN, F_PINF, F_NINF;

void
llt_init(void)
{
	D_PNAN = strtod("+NaN", nil);
	D_NNAN = strtod("-NaN", nil);
	D_PINF = strtod("+Inf", nil);
	D_NINF = strtod("-Inf", nil);

	*(uint32_t*)&F_PNAN = 0x7fc00000;
	*(uint32_t*)&F_NNAN = 0xffc00000;
	*(uint32_t*)&F_PINF = 0x7f800000;
	*(uint32_t*)&F_NINF = 0xff800000;

	randomize();
	ios_init_stdstreams();
}