i've been comparing 4th order Runge-Kutta method i wrote in F90 and in Matlab R2006 and stumbled upon a bizzare thing: is it possible that the two programs have different arithmetic operator priorities????
look at the attached picture: if i use parenthesis to specify the computation order explicitly, then both solutions (rk4 in F90 and in Matlab) coincide(more or less).
but if i remove the parenthesis, Fortran solution stays the same, but Matlab understands the problem in a completely different way:
the code f = 0.1 * t ^ 3 ^ sin(y^2) is understood like this:
Matlab: f = 0.1 * (t ^ 3) ^ sin(y^2)
F90: f = 0.1 * t ^ (3 ^ sin(y^2))
should i be surprised?
look at the attached picture: if i use parenthesis to specify the computation order explicitly, then both solutions (rk4 in F90 and in Matlab) coincide(more or less).
but if i remove the parenthesis, Fortran solution stays the same, but Matlab understands the problem in a completely different way:
the code f = 0.1 * t ^ 3 ^ sin(y^2) is understood like this:
Matlab: f = 0.1 * (t ^ 3) ^ sin(y^2)
F90: f = 0.1 * t ^ (3 ^ sin(y^2))
should i be surprised?