Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

(pow:) macro is broken, takes wrong number of arguments

edited July 2016 in Help! with 2.0
(pow:), the exponentiation macro, isn't working for me.

According to the Harlowe 1.2.2 documentation, (pow:) is supposed to take exactly two values, the base and the exponent. But when I write (pow: $w, 2.5) it doesn't evaluate. I'm told "1 too many values were given to this (pow:) macro. The (pow:) macro must only be given a number."

When I acquiesce to this nonsensical error and write (pow: $w) or (pow: 2.5), it evaluates to NaN. Of course, this is backwards. (pow:) shouldn't evaluate on one argument. You need a base and an exponent.

What is this beginner missing?

Comments

  • Also, there are a couple references to an apparently non-existent (push:) macro. No entry for (push:) itself. What's up with that?
  • You should report each of the errors you find on the Harlowe project's Issues page, so the Developer is aware of them.

    While waiting for them to be fixed you can use the Javascript Math.pow function instead, it is what the macro itself uses.
    (set: $var to Math.pow($w, 2.5))
    
  • Thank you, greyelf!

    I've also just discovered that the (random:) macro, which the doc says can take either one or two args, only takes two. But this bug is not an issue because (random: 0, $x) is equivalent to the documented form (random: $x).
  • Again this forum is not the best place to report possible bugs in the Harlowe story format, you need to create new issues of the project's website.
  • This will be fixed in 1.2.3. Thanks for noticing, and again, posting Bitbucket issues is helpful in bringing this to my notice.
Sign In or Register to comment.