Quote:
Originally Posted by clowntable
A gamma function is used for all other factorials (except the negative integers) i.e. reals including negative (non integer) reals
For example, (-0.5)! = sqrt(PI) = ~1.772
Proof by contradiction!
>> The book is titled
Structure and Interpretation of Computer Programs. This means that you
structure some
programs and you
interpret some
programs, including and not limited to the lowly factorial.
In order to do this, it helps to have a bare-bones language, In this light, it is a bit unfair to compare your higher-level language with Scheme. Scheme is a minimal language with the sole intent of teaching you how to roll your own functions and data structures, therefore Scheme would not include factorial, hash-maps, loops, or anything else that is included in higher level languages.
This doesn't mean Scheme is a particularly good language, but in the parameters of the book, there really isn't anything better. In fact, they were originally looking to use Prolog for the book, but they had to create their own language to express everything they wanted to.