mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
Merge branch 'devel' into uint-range-checks
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
when not defined(profiler) and not defined(memProfiler):
|
||||
{.error: "Profiling support is turned off! Enable profiling by passing `--profiler:on --stackTrace:on` to the compiler (see the Nim Compiler User Guide for more options).".}
|
||||
|
||||
when defined(nimHasUsed):
|
||||
{.used.}
|
||||
|
||||
# We don't want to profile the profiling code ...
|
||||
{.push profiler: off.}
|
||||
|
||||
|
||||
@@ -2880,17 +2880,21 @@ proc max*[T](x: openArray[T]): T =
|
||||
for i in 1..high(x):
|
||||
if result < x[i]: result = x[i]
|
||||
|
||||
proc abs*(x: float): float {.magic: "AbsF64", noSideEffect.} =
|
||||
proc abs*(x: float64): float64 {.noSideEffect, inline.} =
|
||||
if x < 0.0: -x else: x
|
||||
proc min*(x, y: float): float {.magic: "MinF64", noSideEffect.} =
|
||||
proc abs*(x: float32): float32 {.noSideEffect, inline.} =
|
||||
if x < 0.0: -x else: x
|
||||
proc min*(x, y: float32): float32 {.noSideEffect, inline.} =
|
||||
if x <= y or y != y: x else: y
|
||||
proc min*(x, y: float64): float64 {.noSideEffect, inline.} =
|
||||
if x <= y or y != y: x else: y
|
||||
proc max*(x, y: float32): float32 {.noSideEffect, inline.} =
|
||||
if y <= x or y != y: x else: y
|
||||
proc max*(x, y: float64): float64 {.noSideEffect, inline.} =
|
||||
if y <= x or y != y: x else: y
|
||||
proc min*[T: not SomeFloat](x, y: T): T {.inline.} =
|
||||
if x <= y: x else: y
|
||||
proc max*(x, y: float): float {.magic: "MaxF64", noSideEffect.} =
|
||||
if y <= x: x else: y
|
||||
|
||||
proc min*[T](x, y: T): T {.inline.}=
|
||||
if x <= y: x else: y
|
||||
|
||||
proc max*[T](x, y: T): T {.inline.}=
|
||||
proc max*[T: not SomeFloat](x, y: T): T {.inline.} =
|
||||
if y <= x: x else: y
|
||||
{.pop.}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user