Skip to content

Commit a1d5802

Browse files
committed
doc: update doc for Stirling number
1 parent 70ebc52 commit a1d5802

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/numbers.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,15 @@ end
352352
"""
353353
stirlings1(n::Int, k::Int, signed::Bool=false)
354354
355-
Compute the Stirling number of the first kind, ``s(n,k)``.
355+
Compute the Stirling number of the first kind, ``s(n,k)``, for non-negative `n`.
356356
357357
If `signed` is `true`, return the signed value ``(-1)^{n-k} s(n,k)``.
358358
359359
# Examples
360360
```jldoctest
361+
julia> stirlings1(0, 0)
362+
1
363+
361364
julia> stirlings1(5, 5) # s(n, n) = 1
362365
1
363366
@@ -370,7 +373,7 @@ true
370373
julia> stirlings1(6, 3, true)
371374
-225
372375
373-
julia> [(k<=n ? stirlings1(n,k,true) : 0) for n in 1:6, k in 1:6]
376+
julia> [stirlings1(n,k,true) for n in 1:6, k in 1:6]
374377
6×6 Matrix{Int64}:
375378
1 0 0 0 0 0
376379
-1 1 0 0 0 0
@@ -419,7 +422,7 @@ end
419422
"""
420423
stirlings2(n::Int, k::Int)
421424
422-
Compute the Stirling number of the second kind, ``S(n,k)``.
425+
Compute the Stirling number of the second kind, ``S(n,k)``, for non-negative `n`.
423426
424427
# Examples
425428
```jldoctest

0 commit comments

Comments
 (0)