I think the behavior of Random.randRange has changed in the past year (since I last used a homework that suddenly had a bug), and is inconsistent with the documentation. The documentation says "val randRange : (int * int) -> rand -> int
randRange (lo, hi) rand generates a random number in the [lo..hi]. This function will raise the Fail exception if hi < lo." This suggests one should be able to call it with low = hi (and necessarily get low=hi as the output). However,
Version
110.99.4
Operating System
OS Version
Catalina
Processor
System Component
SML/NJ Library
Severity
Minor
Description
I think the behavior of Random.randRange has changed in the past year (since I last used a homework that suddenly had a bug), and is inconsistent with the documentation. The documentation says "val randRange : (int * int) -> rand -> int randRange (lo, hi) rand generates a random number in the [lo..hi]. This function will raise the Fail exception if hi < lo." This suggests one should be able to call it with low = hi (and necessarily get low=hi as the output). However,
Random.randRange (1,1) (Random.rand(1,2));
raises Div.
Transcript
No response
Expected Behavior
No response
Steps to Reproduce
Random.randRange (1,1) (Random.rand(1,2));
Additional Information
No response
Email address
dlicata@wesleyan.edu