[ 
https://issues.apache.org/jira/browse/LUCENE-4148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295765#comment-13295765
 ] 

Dawid Weiss commented on LUCENE-4148:
-------------------------------------

@Robert: sure we could (noting the subtle difference that the range is 
inclusive on both min and max).

As for distribution... I think it should be uniform over all of the range's 
values assuming r.nextDouble() yields uniform value from [0,1]? It's simple 
scaling after all. I didn't really consider nuances of floating point 
representation here but I think within 2^32 a double should cover everything 
fairly well. 
                
> _TestUtil should be able to generate random longs
> -------------------------------------------------
>
>                 Key: LUCENE-4148
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4148
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Adrien Grand
>            Priority: Trivial
>
> It would be helpful in TestPackedInts at least, in order to generate random 
> values (as a workaround, we currently generate a random int between 0 and 
> {{min(Integer.MAX_VALUE, PackedInts.maxValue(bitsPerValue)}}). Moreover, it 
> would help to fix {{nextInt}} for large ranges (calling {{nextInt(random, 
> -10, Integer.MAX_VALUE)}} or even {{nextInt(random, 0, Integer.MAX_VALUE)}} 
> currently fails because the range of values is {{> Integer.MAX_VALUE}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to