Origins of the D Programming Language
mate
aiueo at aiueo.aiueo
Fri Dec 7 13:28:54 UTC 2018
On Friday, 7 December 2018 at 10:34:54 UTC, Nicholas Wilson wrote:
> On Friday, 7 December 2018 at 10:08:04 UTC, Dmitry Olshansky
> wrote:
>> On Friday, 30 November 2018 at 19:34:58 UTC, Andrei
>> Alexandrescu wrote:
>>> [...]
>>
>> Maybe already pointed out in the thread but just in case
>>
>> line 449 has bogus factorial implementation:
>>
>> foreach (i; 0 .. n) result *= i;
>>
>> should probably be
>>
>> foreach (i; 1 .. n) result *= i;
>
> It has, it also bought up the need for unit tests(!) ;)
Indeed, because it should be:
foreach (i; 2 .. n+1) result *= i;
More information about the Digitalmars-d
mailing list