summary refs log tree commit diff stats
path: root/lib/pure/math.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-01-09 14:52:15 +0100
committerAraq <rumpf_a@web.de>2011-01-09 14:52:15 +0100
commit064417fc5a6236e76d959a1a0fb43f68ab099d33 (patch)
treed6afed5332a8b1c8ee9ba5698356c37d4e12bbbf /lib/pure/math.nim
parent8c799da867e1a6b8af48d9ef3ddef281471bd393 (diff)
downloadNim-064417fc5a6236e76d959a1a0fb43f68ab099d33.tar.gz
bugfix: floating point precision; added strutils.formatFloat
Diffstat (limited to 'lib/pure/math.nim')
-rwxr-xr-xlib/pure/math.nim13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/pure/math.nim b/lib/pure/math.nim
index 89a0ccd25..dc6133901 100755
--- a/lib/pure/math.nim
+++ b/lib/pure/math.nim
@@ -1,7 +1,7 @@
 #
 #
 #            Nimrod's Runtime Library
-#        (c) Copyright 2010 Andreas Rumpf
+#        (c) Copyright 2011 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
 #    distribution, for details about the copyright.
@@ -24,6 +24,17 @@ const
   PI* = 3.1415926535897932384626433 ## the circle constant PI (Ludolph's number)
   E* = 2.71828182845904523536028747 ## Euler's number
 
+  MaxFloat64Precision* = 16 ## maximum number of meaningful digits
+                            ## after the decimal point for Nimrod's
+                            ## ``float64`` type.
+  MaxFloat32Precision* = 8  ## maximum number of meaningful digits
+                            ## after the decimal point for Nimrod's
+                            ## ``float32`` type.
+  MaxFloatPrecision* = MaxFloat64Precision ## maximum number of 
+                                           ## meaningful digits
+                                           ## after the decimal point 
+                                           ## for Nimrod's ``float`` type.
+
 type
   TFloatClass* = enum ## describes the class a floating point value belongs to.
                       ## This is the type that is returned by `classify`.