blob: 0d8ee8979771f25ddbaa44ea874fbeef59b5a4ca (
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
|
/* $OpenBSD: exp.c,v 1.1 2006/03/15 21:44:06 otto Exp $ */
/* Written by Otto Moerbeek, 2006, Public domain. */
#include <math.h>
#include <err.h>
int
main(void)
{
double rd, bigd = HUGE_VAL;
float rf, bigf = HUGE_VAL;
rd = exp(bigd);
if (!isinf(rd))
errx(1, "exp(bigd) = %f", rd);
rd = exp(-bigd);
if (rd != 0.0)
errx(1, "exp(-bigd) = %f", rd);
rf = expf(bigf);
if (!isinff(rf))
errx(1, "exp(bigf) = %f", rf);
rf = expf(-bigf);
if (rf != 0.0F)
errx(1, "exp(-bigf) = %f", rf);
return (0);
}
|