Skip to main content

phi

Function phi 

Source
pub const fn phi() -> Relative
Expand description

Returns the golden ratio, about 1.618, as a Relative length.

ยงExamples

use gpui::phi;
let expected = (1.0 + 5f32.sqrt()) / 2.0;
assert!((phi().as_f32() - expected).abs() < 1e-6);