Difference between revisions of "Talk:Pure functions"

From Lazarus wiki
Jump to navigationJump to search
 
Line 1: Line 1:
 
It would be really nice to have it.
 
It would be really nice to have it.
 
Just small note: why should factorial be recursive? It is easily implemented as a cycle, and thus can be pure.
 
Just small note: why should factorial be recursive? It is easily implemented as a cycle, and thus can be pure.
:It does not say it has to be recursive, it's just used as an example in the context of "Remembering Pre-calculated Values". --[[User:Bart|Bart]] ([[User talk:Bart|talk]]) 22:34, 22 December 2021 (CET)
+
:It does not say it has to be recursive, it's just used as an example in the context of "Remembering Pre-calculated Values".(In fact a lookup table with entries [0..20] will suffice, since Fac(21) > High(QWord).) --[[User:Bart|Bart]] ([[User talk:Bart|talk]]) 22:34, 22 December 2021 (CET)

Latest revision as of 22:44, 22 December 2021

It would be really nice to have it. Just small note: why should factorial be recursive? It is easily implemented as a cycle, and thus can be pure.

It does not say it has to be recursive, it's just used as an example in the context of "Remembering Pre-calculated Values".(In fact a lookup table with entries [0..20] will suffice, since Fac(21) > High(QWord).) --Bart (talk) 22:34, 22 December 2021 (CET)