Adjusted manpage for libmormegil::abs
authorfluffymormegil <mpread@chiark.greenend.org.uk>
Sat, 23 Oct 2010 23:47:44 +0000 (00:47 +0100)
committerfluffymormegil <mpread@chiark.greenend.org.uk>
Sat, 23 Oct 2010 23:47:44 +0000 (00:47 +0100)
man/libmormegil::abs.3

index 379b8e8..cd29f81 100644 (file)
@@ -2,9 +2,9 @@
 .SH NAME
 libmormegil::abs \- compute absolute value
 .SH SYNOPSIS
-#include <libmormegil/abs.hh>
+#include <libmormegil/mathops.hh>
 
-template<typename T> T abs(const T& i) { i < T(0) ? -i : i; }
+template<typename T> T libmormegil::abs(const T& i);
 
 .SH DESCRIPTION
 .I libmormegil::abs
@@ -13,13 +13,18 @@ written for libmormegil because the C++ standard library provides only
 floating point (via <cmath> / <math.h>) or complex (via <complex>)
 implementations of this function.
 
+.SH RETURNS
+
+The absolute value (magnitude) of \fIi\fP.
+
 .SH CAVEATS
 
-Implemented as naively as possible.
+Implemented as naively as possible. Breaks horribly if type T has exotic
+behaviour for its lessthan or unary minus operators.
 
 .SH AUTHOR
 Martin Read <mpread@chiark.greenend.org.uk>
 
 .SH SEE ALSO
 
-libmormegil(3), libmormegil::S20prng(3)
+libmormegil(3)