mirror of
https://github.com/Noratrieb/simple-std.git
synced 2026-01-14 16:35:06 +01:00
Fixed documentation spelling error
This commit is contained in:
parent
51554aa8d7
commit
4cc7ae72f9
1 changed files with 4 additions and 4 deletions
|
|
@ -92,9 +92,9 @@ mod random {
|
||||||
///
|
///
|
||||||
/// # Why is this not in std?
|
/// # Why is this not in std?
|
||||||
///
|
///
|
||||||
/// Rust aims to be correct, that's why it's major random number library is cryptographically secure,
|
/// Rust aims to be correct, that's why its major random number library is cryptographically secure,
|
||||||
/// meaning it's randomness can't easily be guessed. And cryptographically secure random number generation
|
/// meaning its randomness can't easily be guessed. And cryptographically secure random number generation
|
||||||
/// is a big task, that's why it has it's own crate.
|
/// is a big task, that's why it has its own crate.
|
||||||
pub fn random_float() -> f64 {
|
pub fn random_float() -> f64 {
|
||||||
((random_u64() >> 11) as f64) / ((1u64 << 53) as f64)
|
((random_u64() >> 11) as f64) / ((1u64 << 53) as f64)
|
||||||
}
|
}
|
||||||
|
|
@ -123,7 +123,7 @@ mod random {
|
||||||
range.start + ((random_u64() as i32).abs() % difference)
|
range.start + ((random_u64() as i32).abs() % difference)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generates a pseudo-random u32
|
/// generates a pseudo-random u64
|
||||||
fn random_u64() -> u64 {
|
fn random_u64() -> u64 {
|
||||||
use std::sync::atomic::{AtomicU64, Ordering};
|
use std::sync::atomic::{AtomicU64, Ordering};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue