mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
add math.signbit (#16592)
This commit is contained in:
@@ -304,6 +304,16 @@ block:
|
||||
|
||||
template main =
|
||||
# xxx wrap all under `main` so it also gets tested in vm.
|
||||
block: # signbit
|
||||
doAssert not signbit(0.0)
|
||||
doAssert signbit(-0.0)
|
||||
doAssert signbit(-0.1)
|
||||
doAssert not signbit(0.1)
|
||||
|
||||
doAssert not signbit(Inf)
|
||||
doAssert signbit(-Inf)
|
||||
doAssert not signbit(NaN)
|
||||
|
||||
block: # isNaN
|
||||
doAssert NaN.isNaN
|
||||
doAssert not Inf.isNaN
|
||||
|
||||
Reference in New Issue
Block a user