github-actions · GitHub

Merged

cmb69

@TimWolla TimWolla changed the title Add Randomizer::nextFloat() Add Randomizer::nextFloat() and Randomizer::getFloat()

Oct 12, 2022

goualard-f

morrisonlevi

@TimWolla

@TimWolla

The algorithm is published in:
Drawing Random Floating-Point Numbers from an Interval. Frédéric
Goualard, ACM Trans. Model. Comput. Simul., 32:3, 2022.
https://doi.org/10.1145/3503512

@TimWolla

…DBL_MANT_DIG

TimWolla

@TimWolla

@TimWolla

TimWolla marked this pull request as ready for review

December 9, 2022 23:14

cmb69

morrisonlevi

@TimWolla

@TimWolla

zeriyoshi

@TimWolla

@TimWolla

@TimWolla

Open

Open

Merged

1 task

adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request

Aug 4, 2026
* random: Add Randomizer::nextFloat()
* random: Check that doubles are IEEE-754 in Randomizer::nextFloat()
* random: Add Randomizer::nextFloat() tests
* random: Add Randomizer::getFloat() implementing the y-section algorithm
The algorithm is published in:
Drawing Random Floating-Point Numbers from an Interval. Frédéric
Goualard, ACM Trans. Model. Comput. Simul., 32:3, 2022.
https://doi.org/10.1145/3503512
* random: Implement getFloat_gamma() optimization
see https://github.com/php/php-src/pull/9679/files#r994668327
* random: Add Random\IntervalBoundary
* random: Split the implementation of γ-section into its own file
* random: Add tests for Randomizer::getFloat()
* random: Fix γ-section for 32-bit systems
* random: Replace check for __STDC_IEC_559__ by compile-time check for DBL_MANT_DIG
* random: Drop nextFloat_spacing.phpt
* random: Optimize Randomizer::getFloat() implementation
* random: Reject non-finite parameters in Randomizer::getFloat()
* random: Add NEWS/UPGRADING for Randomizer’s float functionality

Read the original on github.com ↗