INNER CODE UNIT · Rust

hash_f64

nativeshell/nativeshell · nativeshell/src/codec/value/mod.rs:60

fn hash_f64<H: std::hash::Hasher>(value: f64, state: &mut H) {
    // normalize NAN
    let value: f64 = if value.is_nan() { f64::NAN } else { value };
    let transmuted: u64 = value.to_bits();
    state.write_u64(transmuted);
}

fn hash_map<H: std::hash::Hasher>(map: &HashMap<Value, Value>, state: &mut H) {
    for (key, value) in map {
        key.hash(state);
        value.hash(state);
    }
}

#[allow(renamed_and_removed_lints)]
#[allow(clippy::derive_hash_xor_eq)]
impl std::hash::Hash for Value {
    fn hash<H: std::hash::Hasher>(&self, state: &mut H) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…