Skip to main content

as_fs

Macro as_fs 

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

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

Equivalent to Dt::attos_to_fs.

Truncates toward zero.

Half a femtosecond is 500 attoseconds (no smaller named unit macro).

§Examples

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

use deep_time::macros::{as_fs, fs};

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