Use one same type for two parameters
This commit is contained in:
parent
090ffa3869
commit
5fc5e37194
1 changed files with 1 additions and 5 deletions
|
|
@ -151,10 +151,6 @@ else: # JS
|
||||||
proc log*[T: SomeFloat](x, base: T): T =
|
proc log*[T: SomeFloat](x, base: T): T =
|
||||||
## Computes the logarithm ``base`` of ``x``
|
## Computes the logarithm ``base`` of ``x``
|
||||||
ln(x) / ln(base)
|
ln(x) / ln(base)
|
||||||
proc log*(x: float64, base: float32): float64 =
|
|
||||||
ln(x) / ln(base)
|
|
||||||
proc log*(x: float32, base: float64): float64 =
|
|
||||||
ln(x) / ln(base)
|
|
||||||
|
|
||||||
when not defined(JS): # C
|
when not defined(JS): # C
|
||||||
proc log10*(x: float32): float32 {.importc: "log10f", header: "<math.h>".}
|
proc log10*(x: float32): float32 {.importc: "log10f", header: "<math.h>".}
|
||||||
|
|
@ -676,4 +672,4 @@ when isMainModule:
|
||||||
doAssert floorMod(-8.5, 3.0) ==~ 0.5
|
doAssert floorMod(-8.5, 3.0) ==~ 0.5
|
||||||
|
|
||||||
block: # log
|
block: # log
|
||||||
doAssert log(3.0, 4.0) == log(4.0) / log(3.0)
|
doAssert log(4.0, 3.0) == log(4.0) / log(3.0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue