Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / acceptance_test / Fibonacci / Fibonacci.ttcn
CommitLineData
970ed795 1/******************************************************************************
3abe9331 2 * Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
EL
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 ******************************************************************************/
8module Fibonacci {
9
10const integer NTIMES := 10, NUMBER := 30;
11
12/* another recursive little rascal */
13function fib(in integer x) return integer
14{
15 if (x > 2) {
16 return (fib(x-1)+fib(x-2));
17 } else {
18 return (1);
19 }
20}
21
22control
23{
24 var integer i, v;
25
26 for (i := 1; i <= NTIMES; i := i + 1)
27 {
28 v := fib(NUMBER);
29 }
30
31 // temp = fib(value);
32}
33}
This page took 0.039345 seconds and 5 git commands to generate.