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
be105648
Commit
be105648
authored
6 years ago
by
bg33novu
Browse files
Options
Downloads
Patches
Plain Diff
right now I hate Julia
parent
08988b99
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
+117
-0
117 additions, 0 deletions
references_and_values/pointers.jl
with
117 additions
and
0 deletions
references_and_values/pointers.jl
0 → 100644
+
117
−
0
View file @
be105648
triangle
=
[
2
,
3
,
4
]
triangle2
=
[
2
,
2
,
2
]
triangle2_line
=
[
2
2
2
]
triangle
=
triangle
.+
1
triangle
.+
triangle2
triangle
.*
triangle2
triangle2_line
*
triangle
# mathematical vector multiplication
triangle2
*
triangle
triangle2_line
.*
triangle
triangle_bis
=
triangle
triangle
[
1
]
=
0
triangle_bis
a
=
5
b
=
a
a
=
0
b
function
is_Right
(
lengths
)
for
i
=
1
:
length
(
lengths
)
lengths
[
i
]
=
lengths
[
i
]
^
2
end
println
(
lengths
)
sort!
(
lengths
)
# squares = sort(squares)
println
(
lengths
)
return
(
lengths
[
3
]
==
lengths
[
1
]
+
lengths
[
2
])
end
triangle
=
[
5
,
3
,
4
]
println
(
is_Right
(
triangle
))
println
(
triangle
)
function
is_Right2
(
lengths
)
lengths
=
[
x
^
2
for
x
in
lengths
]
println
(
lengths
)
sort!
(
lengths
)
# squares = sort(squares)
println
(
lengths
)
return
(
lengths
[
3
]
==
lengths
[
1
]
+
lengths
[
2
])
end
triangle
=
[
5
,
3
,
4
]
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
)
sort!
(
lengths
)
# squares = sort(squares)
println
(
lengths
)
return
(
lengths
[
3
]
==
lengths
[
1
]
+
lengths
[
2
])
end
triangle
=
[
5
,
3
,
4
]
println
(
is_Right!
(
triangle
))
println
(
triangle
)
function
recursive_factorial
(
n
)
if
n
==
1
return
(
1
)
else
return
(
n
*
recursive_factorial
(
n
-
1
))
end
end
recursive_factorial
(
12
)
function
loop_factorial
(
n
)
res
=
1
for
i
in
1
:
n
res
=
res
*
i
end
return
(
res
)
end
loop_factorial
(
12
)
@elapsed
recursive_factorial
(
4200
)
@elapsed
loop_factorial
(
4200
)
\ 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