From b4c440089fb2592b391f64d280a07f8ce07fc383 Mon Sep 17 00:00:00 2001 From: Dmitry Neverovski Date: Wed, 20 Nov 2019 20:15:19 +0300 Subject: [PATCH] Update zero factorial The Definition of a Zero Factorial Because zero has no lower numbers but is still in and of itself a number, there is still but one possible combination of how that data set can be arranged: it cannot. This still counts as one way of arranging it, so by definition, a zero factorial is equal to one, just as 1! is equal to one because there is only a single possible arrangement of this data set. --- 03_recursion/Golang/03_factorial/Factorial.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03_recursion/Golang/03_factorial/Factorial.go b/03_recursion/Golang/03_factorial/Factorial.go index 5a0a6e1..2421402 100644 --- a/03_recursion/Golang/03_factorial/Factorial.go +++ b/03_recursion/Golang/03_factorial/Factorial.go @@ -3,7 +3,7 @@ package main import "fmt" func fact(x int) int { - if x == 1 { + if x == 0 { return 1 }