Skip to main content

as_ps

Macro as_ps 

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

Converts total attoseconds (i128) → whole picoseconds (i128).

Equivalent to Dt::attos_to_ps.

Truncates toward zero.

§Examples

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

use deep_time::macros::{as_ps, fs, ps};

// an amount of attoseconds that is equal to
// −1.5 ps becomes −1 picoseconds
assert_eq!(as_ps!(-ps!(1) - fs!(500)), -1);