fix math.frexp function signature (#16725)

This commit is contained in:
flywind 2021-02-17 12:27:48 -06:00 • committed by GitHub
commit 35e14998ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 66 additions and 42 deletions

View file

@ -1,9 +1,8 @@
discard """
targets: "js c cpp"
output: '''ok'''
"""
import math
import std/math
const manualTest = false
@ -43,4 +42,12 @@ when manualTest:
else:
frexp_test(-200000.0, 200000.0, 0.125)
echo "ok"
doAssert frexp(8.0) == (0.5, 4)
doAssert frexp(-8.0) == (-0.5, 4)
doAssert frexp(0.0) == (0.0, 0)
block:
var x: int
doAssert frexp(5.0, x) == 0.625
doAssert x == 3