Task

Calculate the value of   e.



(e   is also known as   Euler's number   and   Napier's constant.)



See details: Calculating the value of e

eApprox
=LAMBDA(n,
    INDEX(
        FOLDROW(
            LAMBDA(efl,
                LAMBDA(x,
                    LET(
                        flx, INDEX(efl, 2) * x,
                        e, INDEX(efl, 1),
 
                        CHOOSE(
                            {1;2},
                            e + (1 / flx),
                            flx
                        )
                    )
                )
            )
        )({1;1})(
            SEQUENCE(1, n)
        ),
        1
    )
)