Crates.io | drand48 |
lib.rs | drand48 |
version | 0.2.0 |
created_at | 2025-05-26 19:19:57.835251+00 |
updated_at | 2025-05-27 19:56:00.222386+00 |
description | drand48 - POSIX.1 standard LCG random number generator |
homepage | https://gitlab.com/hsn10/drand48/ |
repository | https://gitlab.com/hsn10/drand48.git |
max_upload_size | |
id | 1690151 |
size | 27,703 |
drand48 is the Linear Congruential Generator generator included in POSIX / ANSI-C standard employed by drand48() function family.
Parameters are: modulus m = 2^48, multiplier a = 25214903917, increment c = 11. Generator have full period 2^48.
Function next() returns full 48-bit output. Lower bits should be discarded because they have low distribution quality. How many bits you choose to discard depends on your quality needs.
We take the best top bits, discarding lower ones.
2d | 3d | 4d | 5d | 6d | 7d | 8d |
---|---|---|---|---|---|---|
0.51 | 0.80 | 0.45 | 0.58 | 0.66 | 0.80 | 0.60 |
This version of drand48 matches outputs of drand() family in FreeBSD 13 libc.
This is free and unencumbered software released into the public domain.
You may use, modify, distribute, and contribute to this code without restriction. To the extent possible under law, the author(s) of this work waive all copyright and related rights.
Licensed under CC0-1.0 OR Unlicense.