root icon indicating copy to clipboard operation
root copied to clipboard

Removed skipping of 0 (zero) in TRandom3.Rndm()

Open kjvbrt opened this issue 1 year ago • 17 comments

This Pull request: Removes skipping of 0 (zero) in TRandom3.Rndm()

Changes or fixes:

  • Removes skipping of 0 (zero) in TRandom3.Rndm()
  • Updates documentation, adds warnings

Checklist:

  • [x] tested changes locally
  • [x] updated the docs (if necessary)

This PR fixes #14581

kjvbrt avatar Feb 13 '24 18:02 kjvbrt

Can one of the admins verify this patch?

phsft-bot avatar Feb 13 '24 18:02 phsft-bot

@phsft-bot build

hahnjo avatar Feb 13 '24 21:02 hahnjo

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 13 '24 21:02 phsft-bot

Hello: for me this PR is good to go @lmoneta ?

dpiparo avatar Feb 14 '24 08:02 dpiparo

The PR looks good. The doubt I have is that there is a change in functionality. In ROOT, all random generators of TRandom::Random() return a value in (0,1], excluding the zero. Should we add a maybe +1 to the generated integer numbers in [0,int_max], before converting to float ?

lmoneta avatar Feb 14 '24 08:02 lmoneta

@phsft-bot build

hahnjo avatar Feb 14 '24 11:02 hahnjo

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 14 '24 11:02 phsft-bot

Build failed on ROOT-ubuntu2004/python3. See console output.

phsft-bot avatar Feb 14 '24 11:02 phsft-bot

The PR looks good. The doubt I have is that there is a change in functionality. In ROOT, all random generators of TRandom::Random() return a value in (0,1], excluding the zero. Should we add a maybe +1 to the generated integer numbers in [0,int_max], before converting to float ?

Adding +1 to the generated int which is equal to int_max will result again in 0 (zero), no?

kjvbrt avatar Feb 14 '24 11:02 kjvbrt

@phsft-bot build

hahnjo avatar Feb 14 '24 18:02 hahnjo

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 14 '24 18:02 phsft-bot

Test Results

    12 files      12 suites   2d 3h 59m 38s :stopwatch:  2 561 tests  2 542 :white_check_mark: 0 :zzz:  19 :x: 28 812 runs  28 659 :white_check_mark: 0 :zzz: 153 :x:

For more details on these failures, see this check.

Results for commit f501b84e.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Feb 15 '24 15:02 github-actions[bot]

@lmoneta @kjvbrt it seems to me we are very near to the fix: what is missing to make these tests succeed?

dpiparo avatar Feb 28 '24 06:02 dpiparo