cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Rnd in the cycle of Mathcad Prime - an error?

ValeryOchkov
24-Ruby IV

Rnd in the cycle of Mathcad Prime - an error?

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 5

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

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!

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

Uh-oh! Weirder still!!

Dice3.PNG

Alan

It was a preprogram of this program - http://communities.ptc.com/message/184194

See too ne picture:

RndCycleError.png

Top Tags