Limiting an answer to positive numbers

When creating an arithmetic question, is there a way to force the algorithm to create versions that result in only positive numbers?

Answers

  • Pedro.S.874
    Pedro.S.874 Posts: 13

    Hi Mary,

    Yes! You can use "abs({n})," the absolute value of n.

    This article may help you:

    https://community.d2l.com/brightspace/kb/articles/3410-creating-question-library-questions

    Thank you!

  • Mary.W.997
    Mary.W.997 Posts: 3 🔍

    Pedro,

    That works if the defined variable needs to be positive, but I need the result to be positive. Unless I create min/max values that are extreme, I cannot be sure the result will be positive; the result is not defined by the system at all. While this may work for some types of problems, if the answer is negative, making it an absolute value won't make it correct. In the specific case I am trying to solve, it is a growth rate that must be positive. Absolute value does nothing to change the character of the answer from a practical standpoint.

    Thanks for the attempt, though. For what it's worth, I've read the documentation several times and it does nothing to alleviate my frustration.

    Mary