trionan.h 2.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*************************************************************************
 *
 * $Id$
 *
 * Copyright (C) 2001 Bjorn Reese <breese@users.sourceforge.net>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
 *
 ************************************************************************/

18 19 20 21
#ifndef TRIO_NAN_H
#define TRIO_NAN_H

#include "triodef.h"
22 23 24 25

#ifdef __cplusplus
extern "C" {
#endif
26 27 28 29 30 31 32 33 34

enum {
  TRIO_FP_INFINITE,
  TRIO_FP_NAN,
  TRIO_FP_NORMAL,
  TRIO_FP_SUBNORMAL,
  TRIO_FP_ZERO
};

35 36 37
/*
 * Return NaN (Not-a-Number).
 */
38
TRIO_PUBLIC double trio_nan TRIO_PROTO((void));
39 40 41 42

/*
 * Return positive infinity.
 */
43
TRIO_PUBLIC double trio_pinf TRIO_PROTO((void));
44 45 46 47

/*
 * Return negative infinity.
 */
48
TRIO_PUBLIC double trio_ninf TRIO_PROTO((void));
49

50 51 52 53 54
/*
 * Return negative zero.
 */
TRIO_PUBLIC double trio_nzero TRIO_PROTO((TRIO_NOARGS));

55 56 57
/*
 * If number is a NaN return non-zero, otherwise return zero.
 */
58
TRIO_PUBLIC int trio_isnan TRIO_PROTO((double number));
59 60 61 62 63

/*
 * If number is positive infinity return 1, if number is negative
 * infinity return -1, otherwise return 0.
 */
64
TRIO_PUBLIC int trio_isinf TRIO_PROTO((double number));
65

66 67 68
/*
 * If number is finite return non-zero, otherwise return zero.
 */
69 70
#if 0
	/* Temporary fix - these 2 routines not used in libxml */
71
TRIO_PUBLIC int trio_isfinite TRIO_PROTO((double number));
72

73
TRIO_PUBLIC int trio_fpclassify TRIO_PROTO((double number));
74 75 76
#endif

TRIO_PUBLIC int trio_signbit TRIO_PROTO((double number));
77

78
TRIO_PUBLIC int trio_fpclassify_and_signbit TRIO_PROTO((double number, int *is_negative));
79

80 81 82 83
#ifdef __cplusplus
}
#endif

84
#endif /* TRIO_NAN_H */