Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/zmij/src/traits.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / zmij / src / traits.rs` 55 lines ยท 1230 bytes Raw Blame History 1 use core::fmt::Display; 2 use core::ops::{Add, BitAnd, BitOr, BitOrAssign, BitXorAssign, Div, Mul, Shl, Shr, Sub}; 3 4 pub trait Float: Copy { 5 const MANTISSA_DIGITS: u32; 6 const MIN_10_EXP: i32; 7 const MAX_10_EXP: i32; 8 const MAX_DIGITS10: u32; 9 } 10 11 impl Float for f32 { 12 const MANTISSA_DIGITS: u32 = Self::MANTISSA_DIGITS; 13 const MIN_10_EXP: i32 = Self::MIN_10_EXP; 14 const MAX_10_EXP: i32 = Self::MAX_10_EXP; 15 const MAX_DIGITS10: u32 = 9; 16 } 17 18 impl Float for f64 { 19 const MANTISSA_DIGITS: u32 = Self::MANTISSA_DIGITS; 20 const MIN_10_EXP: i32 = Self::MIN_10_EXP; 21 const MAX_10_EXP: i32 = Self::MAX_10_EXP; 22 const MAX_DIGITS10: u32 = 17; 23 } 24 25 pub trait UInt: 26 Copy 27 + From 28 + From 29 + Add 30 + Sub 31 + Mul 32 + Div 33 + BitAnd 34 + BitOr 35 + Shl 36 + Shl 37 + Shl 38 + Shr 39 + Shr 40 + BitOrAssign 41 + BitXorAssign 42 + PartialOrd 43 + Into 44 + Display 45 { 46 type Signed: Ord; 47 } 48 49 impl UInt for u32 { 50 type Signed = i32; 51 } 52 53 impl UInt for u64 { 54 type Signed = i64; 55 }