src/nint128/nint128_math

Search:
Group by:
Source   Edit  

Procs

func abs(x: Int128): Int128 {....raises: [], tags: [], forbids: [].}

Returns the absolute value of x.

Note:

  • If x is low(Int128), an overflow exception is thrown (if overflow checking is turned on).
Source   Edit  
proc floorSqrt(x: Int128): Int128 {....raises: [ValueError], tags: [], forbids: [].}

Returns the floor square root of x.

Notes:

  • Uses binary search without recursion.
  • Uses extended multiplication of two UInt128
Source   Edit