Skip to content

Randomizer::getInt(0, 2**32 - 1) with Mt19937 always returns 1 #9415

Closed

Description

@TimWolla

Description

The following code:

<?php

$r = new Random\Randomizer(new Random\Engine\Mt19937());
var_dump($r->getInt(0, 2**32 - 1));

Resulted in this output:

int(1)

But I expected this output instead:

Not always 1.

PHP Version

Current git master

Operating System

No response

Activity

  1. self-assigned this
    on Aug 24, 2022
  2. added a commit that references this issue on Aug 24, 2022
    68a7d62
  3. added a commit that references this issue on Aug 24, 2022
    0f696e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions