Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Aide de Scilab >> Scilab > Configuration > recursionlimit

recursionlimit

get or set recursion limit

Syntax

limit = recursionlimit()
old = recursionlimit(new)
current = recursionlimit("current")

Arguments

"current"

used to get current recursion level

limit

current recursion limit

new

new recursion limit

old

old recursion limit

Description

Use this function to change the recursion of Scilab. each built-in, macro or overload is a level. This parameter can be setup in Scilab preferences. Default value is set to 1000.

Examples

recursionlimit(20);
function testRecursion()
    printf("recursion: %d\n", recursionlimit("current") - 1);
    testRecursion;
endfunction

testRecursion;
//show that cos and %rec_cos increment the current recursion level.
recursionlimit(40);
function %rec_cos(val)
    printf("recursion: %d\n", recursionlimit("current") - 1);
    val.count = val.count + 1;
    //disp(val.count);
    cos(val);
endfunction

a = tlist(["rec", "count"], 0);
cos(a)
recursionlimit(10);
function [out]=recfib(in)
    printf("recursion: %d\n", recursionlimit("current") - 1);
    if in == 1  then
        out = 1;
    elseif in == 2
        out = 1;
    else
        out = recfib(in-1) + recfib(in-2);
    end
endfunction

recfib(10); //OK
recfib(11); //KO

History

VersionDescription
6.0.0 Added in Scilab 6 family
Report an issue
<< oldEmptyBehaviour Configuration sciargs >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:06:28 CET 2017