summaryrefslogtreecommitdiff
path: root/bin86-0.3/bccfp/fperr.c
blob: d5372dc715a419b7344f82f9937fb276c89b981b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 *   bin86/bccfp/fperr.c
 *
 *   Copyright (C) 1992 Bruce Evans
 */

#include <stdio.h>
#include <signal.h>

#include "fperr.h"

void fperr(errno)
int errno;
{

#if defined(DEBUG) || 0
	switch(errno) {

	case EFDENORMAL:
		fputs("\nDenormal - ", stderr);
		break;

	case EFINFINITY:
		fputs("\nInfinity - ", stderr);
		break;

	case EFNAN:
		fputs("\nNaN - ", stderr);
		break;

	case EFOVERFLOW:
		fputs("\nOverflow - ", stderr);
		break;

	case EFUNDERFLOW:
		fputs("\nUnderflow - ", stderr);
		break;

	case EFDIVZERO:
		fputs("\nZero divide - ", stderr);
		break;

	default:
		fprintf(stderr, "\nUnknown error 0x%x - ", errno);
	}
	fflush(stderr);
#endif

	kill(getpid(), SIGFPE);
}