summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-05-21 00:50:02 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-05-22 07:41:16 +0200
commit11fca968b2cb3714b55141acf39bd1691d7ae8eb (patch)
tree0cdc702381d371e93ffa3b00896f38c12e4d1741 /lib/pure
parent845f89ab54ae73786e26eb76a5ee3bbeba52d000 (diff)
downloadNim-11fca968b2cb3714b55141acf39bd1691d7ae8eb.tar.gz
stdlib: more consistent formatting
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/fenv.nim44
-rw-r--r--lib/pure/math.nim10
2 files changed, 27 insertions, 27 deletions
diff --git a/lib/pure/fenv.nim b/lib/pure/fenv.nim
index ab47da08e..6a6d05f2b 100644
--- a/lib/pure/fenv.nim
+++ b/lib/pure/fenv.nim
@@ -102,7 +102,7 @@ proc feupdateenv*(envp: ptr Tfenv): cint {.importc, header: "<fenv.h>".}
   ## represented by object pointed to by `envp` and raise exceptions
   ## according to saved exceptions.
 
-const 
+const
   FLT_RADIX = 2 ## the radix of the exponent representation
 
   FLT_MANT_DIG = 24 ## the number of base FLT_RADIX digits in the mantissa part of a float
@@ -114,7 +114,7 @@ const
   FLT_MIN = 1.17549435e-38'f32  ## the minimum value of a float
   FLT_MAX = 3.40282347e+38'f32 ## the maximum value of a float
   FLT_EPSILON = 1.19209290e-07'f32  ## the difference between 1 and the least value greater than 1 of a float
- 
+
   DBL_MANT_DIG = 53 ## the number of base FLT_RADIX digits in the mantissa part of a double
   DBL_DIG = 15 ## the number of digits of precision of a double
   DBL_MIN_EXP = -1021 ## the minimum value of base FLT_RADIX in the exponent part of a double
@@ -125,65 +125,65 @@ const
   DBL_MAX = 1.7976931348623157E+308 ## the minimal value of a double
   DBL_EPSILON = 2.2204460492503131E-16 ## the difference between 1 and the least value greater than 1 of a double
 
-template fpRadix* : int = FLT_RADIX
+template fpRadix*: int = FLT_RADIX
   ## The (integer) value of the radix used to represent any floating
   ## point type on the architecture used to build the program.
 
-template mantissaDigits*(T : typedesc[float32]) : int = FLT_MANT_DIG
+template mantissaDigits*(T: typedesc[float32]): int = FLT_MANT_DIG
   ## Number of digits (in base ``floatingPointRadix``) in the mantissa
   ## of 32-bit floating-point numbers.
-template digits*(T : typedesc[float32]) : int = FLT_DIG
+template digits*(T: typedesc[float32]): int = FLT_DIG
   ## Number of decimal digits that can be represented in a
   ## 32-bit floating-point type without losing precision.
-template minExponent*(T : typedesc[float32]) : int = FLT_MIN_EXP
+template minExponent*(T: typedesc[float32]): int = FLT_MIN_EXP
   ## Minimum (negative) exponent for 32-bit floating-point numbers.
-template maxExponent*(T : typedesc[float32]) : int = FLT_MAX_EXP
+template maxExponent*(T: typedesc[float32]): int = FLT_MAX_EXP
   ## Maximum (positive) exponent for 32-bit floating-point numbers.
-template min10Exponent*(T : typedesc[float32]) : int = FLT_MIN_10_EXP
+template min10Exponent*(T: typedesc[float32]): int = FLT_MIN_10_EXP
   ## Minimum (negative) exponent in base 10 for 32-bit floating-point
   ## numbers.
-template max10Exponent*(T : typedesc[float32]) : int = FLT_MAX_10_EXP
+template max10Exponent*(T: typedesc[float32]): int = FLT_MAX_10_EXP
   ## Maximum (positive) exponent in base 10 for 32-bit floating-point
   ## numbers.
-template minimumPositiveValue*(T : typedesc[float32]) : float32 = FLT_MIN
+template minimumPositiveValue*(T: typedesc[float32]): float32 = FLT_MIN
   ## The smallest positive (nonzero) number that can be represented in a
   ## 32-bit floating-point type.
-template maximumPositiveValue*(T : typedesc[float32]) : float32 = FLT_MAX
+template maximumPositiveValue*(T: typedesc[float32]): float32 = FLT_MAX
   ## The largest positive number that can be represented in a 32-bit
   ## floating-point type.
-template epsilon*(T : typedesc[float32]): float32 = FLT_EPSILON
+template epsilon*(T: typedesc[float32]): float32 = FLT_EPSILON
   ## The difference between 1.0 and the smallest number greater than
   ## 1.0 that can be represented in a 32-bit floating-point type.
 
-template mantissaDigits*(T : typedesc[float64]) : int = DBL_MANT_DIG
+template mantissaDigits*(T: typedesc[float64]): int = DBL_MANT_DIG
   ## Number of digits (in base ``floatingPointRadix``) in the mantissa
   ## of 64-bit floating-point numbers.
-template digits*(T : typedesc[float64]) : int = DBL_DIG
+template digits*(T: typedesc[float64]): int = DBL_DIG
   ## Number of decimal digits that can be represented in a
   ## 64-bit floating-point type without losing precision.
-template minExponent*(T : typedesc[float64]) : int = DBL_MIN_EXP
+template minExponent*(T: typedesc[float64]): int = DBL_MIN_EXP
   ## Minimum (negative) exponent for 64-bit floating-point numbers.
-template maxExponent*(T : typedesc[float64]) : int = DBL_MAX_EXP
+template maxExponent*(T: typedesc[float64]): int = DBL_MAX_EXP
   ## Maximum (positive) exponent for 64-bit floating-point numbers.
-template min10Exponent*(T : typedesc[float64]) : int = DBL_MIN_10_EXP
+template min10Exponent*(T: typedesc[float64]): int = DBL_MIN_10_EXP
   ## Minimum (negative) exponent in base 10 for 64-bit floating-point
   ## numbers.
-template max10Exponent*(T : typedesc[float64]) : int = DBL_MAX_10_EXP
+template max10Exponent*(T: typedesc[float64]): int = DBL_MAX_10_EXP
   ## Maximum (positive) exponent in base 10 for 64-bit floating-point
   ## numbers.
-template minimumPositiveValue*(T : typedesc[float64]) : float64 = DBL_MIN
+template minimumPositiveValue*(T: typedesc[float64]): float64 = DBL_MIN
   ## The smallest positive (nonzero) number that can be represented in a
   ## 64-bit floating-point type.
-template maximumPositiveValue*(T : typedesc[float64]) : float64 = DBL_MAX
+template maximumPositiveValue*(T: typedesc[float64]): float64 = DBL_MAX
   ## The largest positive number that can be represented in a 64-bit
   ## floating-point type.
-template epsilon*(T : typedesc[float64]): float64 = DBL_EPSILON
+template epsilon*(T: typedesc[float64]): float64 = DBL_EPSILON
   ## The difference between 1.0 and the smallest number greater than
   ## 1.0 that can be represented in a 64-bit floating-point type.
 
 
 when isMainModule:
-  func is_significant(x: float): bool = 
+  func is_significant(x: float): bool =
     if x > minimumPositiveValue(float) and x < maximumPositiveValue(float): true
     else: false
 
diff --git a/lib/pure/math.nim b/lib/pure/math.nim
index 442c45ead..c435c5355 100644
--- a/lib/pure/math.nim
+++ b/lib/pure/math.nim
@@ -646,9 +646,9 @@ when not defined(JS): # C
     # this implementation was inspired by Go-lang Math.Trunc
     proc truncImpl(f: float64): float64 =
       const
-        mask : uint64 = 0x7FF
+        mask: uint64 = 0x7FF
         shift: uint64 = 64 - 12
-        bias : uint64 = 0x3FF
+        bias: uint64 = 0x3FF
 
       if f < 1:
         if f < 0: return -truncImpl(-f)
@@ -666,9 +666,9 @@ when not defined(JS): # C
 
     proc truncImpl(f: float32): float32 =
       const
-        mask : uint32 = 0xFF
+        mask: uint32 = 0xFF
         shift: uint32 = 32 - 9
-        bias : uint32 = 0x7F
+        bias: uint32 = 0x7F
 
       if f < 1:
         if f < 0: return -truncImpl(-f)
@@ -846,7 +846,7 @@ when not defined(JS):
     ## m.
     ##
     ## .. code-block:: nim
-    ##  var x : int
+    ##  var x: int
     ##  echo frexp(5.0, x) # 0.625
     ##  echo x # 3
     var exp: int32