mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(mathutil): honour Fibonacci seeds at the first positions (#362)
This commit is contained in:
1 parent
a296281408
commit
172712df30
2 files changed
+8
-2
No files matched your search
@@ -35,8 +35,10 @@ func Fibonacci(first, second, n int) int {
|
||||
if n <= 0 {
|
||||
return 0
|
||||
}
|
||||
if n < 3 {
|
||||
return 1
|
||||
if n == 1 {
|
||||
return first
|
||||
} else if n == 2 {
|
||||
return second
|
||||
} else if n == 3 {
|
||||
return first + second
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user