Skip to content

Commit

Permalink
fix(doc): lgamma doc thought NaN == NaN; math_patch.consts used bare *
Browse files Browse the repository at this point in the history
  • Loading branch information
litlighilit committed Sep 26, 2024
1 parent 2e5cc7a commit 333dd65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pylib/Lib/math_patch/consts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const

EULER* = ## euler_gamma
0.577215664901532860606512090082402431042
SQRT_TWO_PI* = ## sqrt(2*PI) <-> sqrt(TAU)
SQRT_TWO_PI* = ## `sqrt(2*PI)` <-> `sqrt(TAU)`
2.506628274631000502415765284811045253

template maxSafeInteger*(F: typedesc[SomeFloat]): F =
Expand Down
3 changes: 2 additions & 1 deletion src/pylib/Lib/math_patch/lgamma.nim
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,10 @@ func lgamma*[F: SomeFloat](x: F): F =
]##

runnableExamples:
from std/math import isNaN
assert lgamma(1.0) == 0.0
assert lgamma(Inf) == Inf
assert lgamma(NaN) == NaN
assert lgamma(NaN).isNaN
mapRaiseGammaErr x.lgamma result

func stdlibJsLgamma*[F: SomeFloat](x: F): F{.raises: [].} =
Expand Down

0 comments on commit 333dd65

Please sign in to comment.