summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/geometry.h
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/dimension/geometry.h')
-rw-r--r--libdimension/dimension/geometry.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h
index 87e7ab7..4c4f8b8 100644
--- a/libdimension/dimension/geometry.h
+++ b/libdimension/dimension/geometry.h
@@ -96,6 +96,13 @@ dmnsn_degrees(double radians)
return radians*45.0/atan(1.0);
}
+DMNSN_INLINE int
+dmnsn_signbit(double n)
+{
+ /* Guarantee a 1 or 0 return, to allow testing two signs for equality */
+ return signbit(n) ? 1 : 0;
+}
+
/* Shorthand for vector/matrix construction */
DMNSN_INLINE dmnsn_vector