some ripples from branch logic change

This commit is contained in:
Torsten Ruger 2015-11-14 00:22:00 +02:00
parent 6e7c6d814a
commit 39eed43358
2 changed files with 5 additions and 6 deletions

View File

@ -7,7 +7,7 @@ class TestRecursinveFibo < MiniTest::Test
@string_input = <<HERE @string_input = <<HERE
class Object class Object
int fibonaccir( int n ) int fibonaccir( int n )
if_plus( n - 1 ) if_plus( n - 2 )
int tmp int tmp
tmp = n - 1 tmp = n - 1
int a = fibonaccir( tmp ) int a = fibonaccir( tmp )

View File

@ -9,12 +9,11 @@ class Object
int fibonaccit(int n) int fibonaccit(int n)
int a = 0 int a = 0
int b = 1 int b = 1
n = n - 1 while_plus( n - 2)
while_plus( n ) n = n - 1
int tmp = a int tmp = a
a = b a = b
b = tmp + b b = tmp + b
n = n - 1
end end
b.putint() b.putint()
return b return b
@ -30,7 +29,7 @@ HERE
def test_while_fibo48 def test_while_fibo48
fibo 48 fibo 48
@length = 1149 @length = 1241
# this is not the correct fibo, just what comes from wrapping (smaller than below) # this is not the correct fibo, just what comes from wrapping (smaller than below)
check_return 512559680 check_return 512559680
end end
@ -38,7 +37,7 @@ HERE
# highest 32 bit fibo # highest 32 bit fibo
def test_while_fibo47 def test_while_fibo47
fibo 47 fibo 47
@length = 1126 @length = 1216
check_return 2971215073 check_return 2971215073
end end