Search code examples
python-3.xjuliaijulia-notebook

Julia.I decided to test some math in Julia and I got an error


Here is an expression, check it yourself:

  • Julia: ((((9^0.5)^3)^2)^2)/((-2)^(-3))
  • Python: ((((9**0.5)**3)**2)**2)/((-2)**-3)

enter image description here


Solution

  • Use PyCall to test whether the results are identical. The py"" string macro will allow you to easily compare results from Python and Julia.

    julia> using PyCall
    
    julia> py"((((9**0.5)**3)**2)**2)/((-2)**-3)" == ((((9^0.5)^3)^2)^2)/((-2)^(-3))
    true