pow and sqrt macros not working in Harlowe
Created originally on Bitbucket by Anonymous
Some of the math macros in Harlowe are not working functioning correctly, and they always evaluate to zero.
For example:
#!
(set: $num to (sqrt: 25) )
The sqrt of 25 is $num
//When run displays:
//The sqrt of 25 is 0
(set: $num to (pow: 2,8) )
The sqrt of 25 is $num
//Returns an error that pow only takes 1 argument
Using the javascript math functions seems to be an acceptable workaround, though they seem to have a parsing error. Though the error is annoying, it too has a workaround (though an odd one)
#!
<!--This works fine-->
(set: $n to Math.sqrt(25))
<!--This does not work-->
(set: $n to 25)\
(set: $b to Math.sqrt($n))
sqrt of $n: $b
//Displays $b as NaN
<!--This seems to work for somereason-->
(set: $num to 25)
(set: $num2 to Math.sqrt( 0 + $num ) )
sqrt of $num: $num2