chiark / gitweb /
@@@ man wip
[mLib] / utils / maths.3
diff --git a/utils/maths.3 b/utils/maths.3
new file mode 100644 (file)
index 0000000..0d6afa5
--- /dev/null
@@ -0,0 +1,36 @@
+.\" -*-nroff-*-
+.TH linreg 3 "9 March 2024" "Straylight/Edgeware" "mLib utilities library"
+.\" @NANPN
+.\" @INFP
+.\" @NEGP
+.
+.SH SYNOPSIS
+.nf
+.B "#include <mLib/maths.h>"
+
+.BI "int NANP(" floatish " " x );
+.BI "int INFP(" floatish " " x );
+.BI "int NEGP(" floatish " " x );
+.fi
+.
+.SH DESCRIPTION
+The
+.B <mLib/maths.h>
+header declares some minor low-level floating-point utilities.
+These are mostly redundant with C99,
+but provided for portability to older platforms.
+.PP
+The
+.B NANP
+macro returns nonzero if its argument is not-a-number.
+The
+.B INFP
+macro returns nonzero if its argument is infinite.
+The
+.B NEGP
+macro returns nonzero if its argument is negative;
+on IEEE\ 754 platforms with sufficient support,
+it will correctly detect negative zero.
+.
+.SH AUTHOR
+Mark Wooding, <mdw@distorted.org.uk>