Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / regress / lib / libc / ieeefp / infinity / infinity.c
blob797f710c89e14c9932c2f0bb5a53fe08c8f94ee1
1 /* $NetBSD: infinity.c,v 1.4 2004/03/05 01:00:53 kleink Exp $ */
3 /*
4 * This file is in the Public Domain.
6 * Ben Harris, 2001
7 */
9 /*
10 * Check that HUGE_VAL{,FL} (alias __infinity{,fl}) really is infinite.
11 * Alternatively, check that isinf() minimally works.
14 #include <assert.h>
15 #include <math.h>
17 int
18 main(int argc, char **argv)
21 /* HUGE_VAL is meant to be an infinity. */
22 assert(isinf(HUGE_VAL));
24 /* HUGE_VALF is the float analog of HUGE_VAL. */
25 assert(isinf(HUGE_VALF));
27 /* HUGE_VALL is the long double analog of HUGE_VAL. */
28 assert(isinf(HUGE_VALL));
30 return 0;