Lately I've been trying to brush up on the math I should have learned in high school. (I didn't pay much attention.) Regarding this, college entrance exams and
octave make a great pair.
This morning I got to fractional powers. And
octave had something surprising in store:
octave:41> (9 ^ 1/2) ans = 4.5000 octave:42> (9 ^ .5) ans = 3 octave:43> (9 ^ 0.5) ans = 3
Maybe I dozed off when we covered this in high school, but no... According to this website,
By the way, some decimal powers can be written as fractional exponents, too. If you are given something like "35.5", recall that 5.5 = 11/2, so:
3 ^ 5.5 = 3 ^ 11/2
So evidently there's some reason why
octave evaluates these two expressions differently...
octave evaluate fractional powers differently? Is this a non-feature, or is there a good reason why it should?