_
This commit is contained in:
@@ -21,5 +21,8 @@ reallyslowfunction() = sleep(2)
|
|||||||
sleep(1)
|
sleep(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# The @inbounds macro removes all checks to see if you try to acces elements
|
||||||
|
# outside any container, so might be faster, but definately more unsafe.
|
||||||
|
a = [1, 2, 3]
|
||||||
|
@inbounds println(a[2])
|
||||||
|
|
||||||
|
@@ -26,8 +26,8 @@ function main()
|
|||||||
|
|
||||||
# Integer division is done by div, fld or cld (floor divide/ceil divide)
|
# Integer division is done by div, fld or cld (floor divide/ceil divide)
|
||||||
# div rounds towards zero (1.5 -> 1, -2.7 -> -2)
|
# div rounds towards zero (1.5 -> 1, -2.7 -> -2)
|
||||||
# floor rounds downwards (1.5 -> 1, -2.7 -> -3)
|
# floor rounds downwards (1.5 -> 1, -2.7 -> -3)
|
||||||
# ceil rounds upwards (1.5 -> 2, -2.7 -> -2)
|
# ceil rounds upwards (1.5 -> 2, -2.7 -> -2)
|
||||||
c = div(a, b)
|
c = div(a, b)
|
||||||
c = fld(a, b)
|
c = fld(a, b)
|
||||||
c = cld(a, b)
|
c = cld(a, b)
|
||||||
|
@@ -56,7 +56,7 @@ println(s)
|
|||||||
println("a + b = ", a + b)
|
println("a + b = ", a + b)
|
||||||
|
|
||||||
|
|
||||||
# The raw string macro is very useful when copying raw text and not
|
# The "raw" string macro is very useful when copying raw text and not
|
||||||
# wanting to worry about special characters doing special stuff
|
# wanting to worry about special characters doing special stuff
|
||||||
# (i.e. \n for new line). A common use for this is filepaths
|
# (i.e. \n for new line). A common use for this is filepaths
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user