Skip to main content
24-Ruby IV
June 19, 2012
Question

Rnd in the cycle of Mathcad Prime - an error?

  • June 19, 2012
  • 5 replies
  • 1692 views

I see an error by the using rnd function in the cycle of Mathcad Prime - see attach. In Mathcad 15 all is OK!

See the picture and Mathcad 12 and Prime 2.0 files.

RndCycleError.png

5 replies

19-Tanzanite
June 19, 2012

Your picture (for Mathcad Prime) has the word Dice twice rather than Dice1 and Dice2 However, even correcting this the result you show still stands.

If you replace 1+floor(rnd(6)) by ceil(rnd(6)) you get essentially the same result as for M15, suggesting the problem is with the floor function rather than with rnd.

Dice.PNG

Alan

24-Ruby IV
June 19, 2012

Tahks, Alan!

You see the error too!

1+floor(rnd(6))

ceil(rnd(6))

works correct too.

But

1+floor(rnd(6))

1+floor(rnd(6))

not.

I have sent the message with this error to Mona!

19-Tanzanite
June 19, 2012

Here are two versions that use floor(rnd(6)) twice and do work! The second example suggests things go astray when adding 1 to the random integers!!!!

Dice2.PNG

Alan