blob: ab2102d74f74c81cb08f9922120882e224c837a5 [file] [log] [blame]
Bjorn Reese45029602001-08-21 09:23:53 +00001/*************************************************************************
2 *
3 * $Id$
4 *
5 * Copyright (C) 2001 Bjorn Reese <breese@users.sourceforge.net>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
13 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
14 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
15 *
16 ************************************************************************/
17
Bjorn Reese026d29f2002-01-19 15:40:18 +000018#ifndef TRIO_NAN_H
19#define TRIO_NAN_H
20
21#include "triodef.h"
Bjorn Reese45029602001-08-21 09:23:53 +000022
23#ifdef __cplusplus
24extern "C" {
25#endif
Daniel Veillard21458c82002-03-27 16:12:22 +000026
27enum {
28 TRIO_FP_INFINITE,
29 TRIO_FP_NAN,
30 TRIO_FP_NORMAL,
31 TRIO_FP_SUBNORMAL,
32 TRIO_FP_ZERO
33};
34
Bjorn Reese45029602001-08-21 09:23:53 +000035/*
36 * Return NaN (Not-a-Number).
37 */
Bjorn Reese026d29f2002-01-19 15:40:18 +000038TRIO_PUBLIC double trio_nan(void);
Bjorn Reese45029602001-08-21 09:23:53 +000039
40/*
41 * Return positive infinity.
42 */
Bjorn Reese026d29f2002-01-19 15:40:18 +000043TRIO_PUBLIC double trio_pinf(void);
Bjorn Reese45029602001-08-21 09:23:53 +000044
45/*
46 * Return negative infinity.
47 */
Bjorn Reese026d29f2002-01-19 15:40:18 +000048TRIO_PUBLIC double trio_ninf(void);
Bjorn Reese45029602001-08-21 09:23:53 +000049
50/*
51 * If number is a NaN return non-zero, otherwise return zero.
52 */
Bjorn Reese026d29f2002-01-19 15:40:18 +000053TRIO_PUBLIC int trio_isnan(double number);
Bjorn Reese45029602001-08-21 09:23:53 +000054
55/*
56 * If number is positive infinity return 1, if number is negative
57 * infinity return -1, otherwise return 0.
58 */
Bjorn Reese026d29f2002-01-19 15:40:18 +000059TRIO_PUBLIC int trio_isinf(double number);
Bjorn Reese45029602001-08-21 09:23:53 +000060
Daniel Veillard21458c82002-03-27 16:12:22 +000061/*
62 * If number is finite return non-zero, otherwise return zero.
63 */
64TRIO_PUBLIC int trio_isfinite(double number);
65
66TRIO_PUBLIC int trio_signbit(double number);
67
68TRIO_PUBLIC int trio_fpclassify(double number);
69
70TRIO_PUBLIC double trio_nzero(void);
71
Bjorn Reese45029602001-08-21 09:23:53 +000072#ifdef __cplusplus
73}
74#endif
75
Bjorn Reese026d29f2002-01-19 15:40:18 +000076#endif /* TRIO_NAN_H */