Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
hws_random
Function nameDescriptionArgument typeReturn typeExampleDefault answerAlternate answer(s)
randomStep(min,max, precisionstep, defaultdef)Generates a random numbernumbersstring or doublehws_randomrandomStep(1.00, 5.99, 1, 3, 2.59)32.593.541, 2, 4, 5
roundoff(num, precision)

Rounds off a number

Note: drops trailing zeros

numbersstring or double

roundoff(4.056, 3)

x=4.02 roundoff(x, 2)

4.06

4

 
sigfig(num, precision)Rounds off a number.numbersstring

sigfig(4.056, 3)

x=4.02 sigfig(x, 2)

4.06

4.0

 
      reducedFrac(a,b)Reduces a/b to simplest formint or doublechar*reducedFrac(12,6)2