Sujet : exercise in double number arithmetic
De : krishna.myneni (at) *nospam* ccreweb.org (Krishna Myneni)
Groupes : comp.lang.forthDate : 06. Jul 2024, 21:20:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6c8v0$3usoe$1@dont-email.me>
User-Agent : Mozilla Thunderbird
I've been working on extending the kForth-64 User's Manual and, in particular, illustrating double length arithmetic, which, being one of the strengths of Forth, often does not get enough exposure. Here's an exercise which you can do using only standard Forth words.
How many different ways can you choose 42 distinct objects, 21 at a time? This is "n choose k" or the binomial coefficent.
Please show your code.
--
Krishna Myneni