Thread View: comp.lang.c
1 messages
1 total messages
Started by Tim Rentsch
Wed, 07 Oct 2026 05:13
Re: MISRA C
Author: Tim Rentsch
Date: Wed, 07 Oct 2026 05:13
Date: Wed, 07 Oct 2026 05:13
25 lines
2524 bytes
2524 bytes
antispam@fricas.org (Waldek Hebisch) writes:
> AFAIK when you allocate memory at the start some functional folks
> will still call it iterative. After all you can just use one
> vector valued variables plus possibly a fixed number of temporaries.
> Only when you really do allocation on the stack and access the
> allocated values in stack-like manner it is considerd trurly
> recursive. AFAICS the following has recursion depth of m and
> uses fixed number of variables per recursion level:
>
> bigint A(bigint m, bigint n) {
> if (m == 0) {
> return n + 1;
> }
> bigint res = 1;
> for(bigint l = 0; l <= n; l++) {
> tmp = A(m - 1, tmp);
> }
> return res;
> }
>
> where bigint is appropriate type for unbounded integers.
Thank you for this definition, which is a great way of
explaining Ben's point.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads