Skip to main content

as_sec_f

Macro as_sec_f 

Source
macro_rules! as_sec_f {
    ($x:expr) => { ... };
}
Expand description

Converts total attoseconds (i128) โ†’ lossy float seconds (Real).

Equivalent to Dt::attos_to_sec_f.

ยงExamples

Example shows attos inputs being built with macros rather than counting attosecond zeros by hand.

use deep_time::macros::{as_sec_f, ms, sec};

// an amount of attoseconds that is equal to
// โˆ’1.5 s becomes -1.5 seconds
assert_eq!(as_sec_f!(-sec!(1) - ms!(500)), -1.5);