Skip to content
Snippets Groups Projects
Commit a5de11d5 authored by bg33novu's avatar bg33novu
Browse files

better to commit after saving than before

parent be105648
No related branches found
No related tags found
No related merge requests found
......@@ -20,13 +20,77 @@ triangle[1] = 0
triangle_bis
triangle_bis .= triangle
triangle[1] = 0
triangle_bis
a = 5
b = a
a = 0
b
function temp(a)
a = [4,5,6]
end
function temp1(a)
a .= [4,5,6]
end
triangle = [2, 3, 4]
temp(triangle)
triangle
temp1(triangle)
function is_Right(lengths)
squares = lengths .* lengths
sort!(squares)
println(squares)
return(squares[3] == squares[1] + squares[2])
end
triangle = [5, 3, 4]
is_Right(triangle)
println(is_Right(triangle))
println(triangle)
function is_Right_but_false(lengths)
sort!(lengths .* lengths)
println(lengths)
return(lengths[3] == lengths[1] + lengths[2])
end
triangle = [5, 3, 4]
is_Right(triangle)
println(is_Right(triangle))
println(triangle)
function is_Right_and_correct(lengths)
lengths = sort(lengths .* lengths)
println(lengths)
return(lengths[3] == lengths[1] + lengths[2])
end
triangle = [5, 3, 4]
is_Right(triangle)
println(is_Right(triangle))
println(triangle)
function is_Right1(lengths)
for i=1:length(lengths)
lengths[i] = lengths[i]^2
end
......@@ -59,21 +123,6 @@ println(is_Right!(triangle))
println(triangle)
function temp(a)
a = [4,5,6]
end
function temp1(a)
a .= [4,5,6]
end
triangle = [2, 3, 4]
temp(triangle)
triangle
temp1(triangle)
function is_Right2Bis(lengths)
lengths .= [x^2 for x in lengths]
println(lengths)
......@@ -113,5 +162,5 @@ end
loop_factorial(12)
@elapsed recursive_factorial(4200)
@elapsed loop_factorial(4200)
\ No newline at end of file
@elapsed recursive_factorial(14200)
@elapsed loop_factorial(14200)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment