[
https://issues.apache.org/jira/browse/MATH-1141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14084784#comment-14084784
]
Phil Steitz commented on MATH-1141:
-----------------------------------
I agree with the OP that this should be fixed. Setting upper = lower here
amounts to an integer-valued constant distribution, which is a legitimate
degenerate case. I guess in theory you could say the same thing about the real
(continuous) case, but it makes more sense to me in the discrete case.
> UniformIntegerDistribution should make constructer a exclusive bound or made
> parameter check more relax
> -------------------------------------------------------------------------------------------------------
>
> Key: MATH-1141
> URL: https://issues.apache.org/jira/browse/MATH-1141
> Project: Commons Math
> Issue Type: Wish
> Reporter: milesandnick
> Priority: Minor
>
> UniformIntegerDistribution constructer public
> UniformIntegerDistribution(RandomGenerator rng,
> int lower,
> int upper)
> the lower and the upper all inclusive. but the parameter check made a if
> (lower >= upper) {
> throw new NumberIsTooLargeException(
>
> LocalizedFormats.LOWER_BOUND_NOT_BELOW_UPPER_BOUND,
> lower, upper, false);
> check, i think it is too strict
> to construct UniformIntegerDistribution (0,0)
> this should make it possible
--
This message was sent by Atlassian JIRA
(v6.2#6252)