Advertisement
Guest User

test.jl

a guest
Feb 11th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Julia 0.73 KB | None | 0 0
  1. Φ = (5 + 1) / 2
  2. ϕ = (5 - 1) / 2
  3. τ = 2π
  4. Σ = sum
  5. Π = prod
  6. ans = [1 / ϕ, 1 / Φ]
  7. (1 / ϕ ≉  Φ, " ", 1 / Φ ≠ ϕ)
  8.  
  9. spaghetti(λ::Function, args::Array{Int64}) = reduce(λ, args)
  10. spaghoot(spaghet) = println(spaghet)
  11. # spaghetti(+, (2 for i ∈ 0:24)...)
  12.  
  13. const bloo = [1:1000000;]
  14. @time reduce(*, bloo::Array{Int64})
  15. @time spaghetti(*, bloo::Array{Int64})
  16.  
  17. cd("Julia\\")
  18. @time begin
  19.     F = open("hello.txt")
  20.     read_uppercase(F::IOStream) = uppercase.(readlines(F))
  21.     read_uppercase(F)
  22. end
  23.  
  24. @time time_rand(x) = @time rand(x)
  25.  
  26. time_rand(1)
  27.  
  28. f(x::Int64) = 3x^2 + 4x + 7x^3
  29. @time f(1)
  30. @time f(2)
  31. @time f.(bloo::Array{Int64})
  32.  
  33. array = [i * j for i ∈ 1:5, j ∈ 1:5]
  34. array[array .≡ 3] .= 30
  35. array
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement