You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2018/10/03 17:03:45 UTC
[Bug 62738] RANDBETWEEN function rounds the value down to int
https://bz.apache.org/bugzilla/show_bug.cgi?id=62738
--- Comment #2 from Yegor Kozlov <ye...@dinom.ru> ---
I think we can return
java.util.concurrent.ThreadLocalRandom.current().nextDouble(bottom, top + 1).
It is the right way to generate a random number in a range in Java 1.7+.
Also, the code sets bottom to top if it is greater than it:
if(bottom > top) {
top = bottom;
}
This check changes the semantics of RANDBETWEEN. Excel returns #NUM! in such a
case
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org