fix: use standard golden ratio constant

pull/376/head
zijiren233 2 months ago
parent b74f0fb6e3
commit 362e7b551d
No known key found for this signature in database
GPG Key ID: 534E082AAA9B39DC

@ -46,6 +46,7 @@ perf = { level = "deny", priority = -1 }
cargo = { level = "deny", priority = -1 }
todo = "deny"
unwrap_used = "deny"
assert_is_empty = "allow"
doc_markdown = "allow"
struct_excessive_bools = "allow"
case_sensitive_file_extension_comparisons = "allow"

@ -283,7 +283,7 @@ mod tests {
fn test_byte_order() {
use byteorder::{BigEndian, ByteOrder};
let phi = 1.618_033_988_7;
let phi = std::f64::consts::GOLDEN_RATIO;
let mut buf = [0; 8];
BigEndian::write_f64(&mut buf, phi);
assert_eq!(phi.to_bits(), BigEndian::read_f64(&buf).to_bits());

Loading…
Cancel
Save