8000 ENH: Add support for extended precision standard uniform variables · Issue #18840 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
ENH: Add support for extended precision standard uniform variables #18840
Open
@bashtage

Description

@bashtage

Feature

Standard uniform random variables underly many other random algorithms. For example, choice makes use of standard uniforms when sampling with non-uniform probabilities. Generator.random already supports the dtype argument but is limited to float32 and float64. It would be useful for anyone working in higher precision to have support for longdouble and other extended precision values available on specific platform.

import numpy as np
gen = np.random.default_rng() 
gen.random(1, dtype=np.longdouble)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0