Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
julia4ever
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Boy
julia4ever
Commits
a5de11d5
Commit
a5de11d5
authored
6 years ago
by
bg33novu
Browse files
Options
Downloads
Patches
Plain Diff
better to commit after saving than before
parent
be105648
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
references_and_values/pointers.jl
+66
-17
66 additions, 17 deletions
references_and_values/pointers.jl
with
66 additions
and
17 deletions
references_and_values/pointers.jl
+
66
−
17
View file @
a5de11d5
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment