some ripples from branch logic change
This commit is contained in:
parent
6e7c6d814a
commit
39eed43358
@ -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 )
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user