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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bashtage opened this issue Apr 23, 2021 · 2 comments
Open

ENH: Add support for extended precision standard uniform variables #18840

bashtage opened this issue Apr 23, 2021 · 2 comments

Comments

@bashtage
Copy link
Contributor

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)
@bashtage
Copy link
Contributor Author

For a specific use case, this feature is needed to implement #6132.

@bashtage bashtage changed the title ENH: Add support for extended prevision standard uniform variables ENH: Add support for extended precision standard uniform variables Apr 23, 2021
@BvB93
Copy link
Member
BvB93 commented Apr 27, 2021

Maybe a bit beyond the scope of this issue, but another place where clongdouble/longdouble
(and half) are currently unsupported is in np.linalg:

_real_types_map = {single : single,
double : double,
csingle : single,
cdouble : double}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0