@@@ much mess, mostly manpages
[mLib] / utils / maths.3.in
diff --git a/utils/maths.3.in b/utils/maths.3.in
new file mode 100644 (file)
index 0000000..9794b91
--- /dev/null
@@ -0,0 +1,82 @@
+.\" -*-nroff-*-
+.\"
+.\" Manual for mathematical definitions
+.\"
+.\" (c) 2024 Straylight/Edgeware
+.\"
+.
+.\"----- Licensing notice ---------------------------------------------------
+.\"
+.\" This file is part of the mLib utilities library.
+.\"
+.\" mLib is free software: you can redistribute it and/or modify it under
+.\" the terms of the GNU Library General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or (at
+.\" your option) any later version.
+.\"
+.\" mLib is distributed in the hope that it will be useful, but WITHOUT
+.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
+.\" License for more details.
+.\"
+.\" You should have received a copy of the GNU Library General Public
+.\" License along with mLib.  If not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+.\" USA.
+.
+.\"--------------------------------------------------------------------------
+.so ../defs.man \" @@@PRE@@@
+.
+.\"--------------------------------------------------------------------------
+.TH math 3mLib "9 March 2024" "Straylight/Edgeware" "mLib utilities library"
+.\" @NANPN
+.\" @INFP
+.\" @NEGP
+.
+.\"--------------------------------------------------------------------------
+.NAME
+maths \- mathematical utilities
+.
+.\"--------------------------------------------------------------------------
+.SH SYNOPSIS
+.
+.nf
+.B "#include <mLib/maths.h>"
+.PP
+.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 "SEE ALSO"
+.
+.BR mLib (3).
+.
+.\"--------------------------------------------------------------------------
+.SH AUTHOR
+.
+Mark Wooding, <mdw@distorted.org.uk>
+.
+.\"----- That's all, folks --------------------------------------------------