# Exemples / DO-DON'T — Chapitre 5 — Types primitifs > Document compagnon. Les exemples illustrent les règles du chapitre ; la formulation normative reste dans le chapitre lui-même. ## Exemples extraits du chapitre ### Exemple 1 ```text int8 int16 int32 int64 int128 int256 uint8 uint16 uint32 uint64 uint128 uint256 float16 float32 float64 float128 bool char ``` ### Exemple 2 ```text -> Void Result Result ``` ### Exemple 3 ```text func save() -> Result { ... return Result::Ok(Void); } ``` ### Exemple 4 ```text Void value; field Void Option Nullable Array Range ``` ### Exemple 5 ```text value::toString() float16::fromInt32(value) ``` ### Exemple 6 ```text overflow statiquement prouvable -> erreur de compilation overflow dynamique -> faute runtime déterministe ``` ### Exemple 7 ```text wrapping saturating checked ``` ### Exemple 8 ```text statique -> erreur compilation dynamique -> faute runtime ``` ### Exemple 9 ```text a == (a / b) * b + (a % b) ``` ### Exemple 10 ```text 42 decimal 0b101010 binary 0o52 octal 0x2a hexadecimal ``` ### Exemple 11 ```text 1_000_000 0b1010_1100 0xffff_ffff 1.234_567 1.0e1_000 ``` ### Exemple 12 ```text 1.0 0.5 42.25 1e6 1.5e-3 ``` ### Exemple 13 ```text i8 i16 i32 i64 i128 i256 u8 u16 u32 u64 u128 u256 f16 f32 f64 f128 ``` ### Exemple 14 ```text 42i32 42u64 1.5f16 ``` ### Exemple 15 ```text 0x1.0p0 0x1.8p1 0x1.ffp10 0x1.0p-20 ``` ### Exemple 16 ```text 1f16 1::toFloat16() ``` ### Exemple 17 ```text bitcast(value) ``` ### Exemple 18 ```text where T implements Numeric ``` ## DO / DON'T / WHY / compiler error / edge cases À consolider progressivement avant la baseline publique V3 et à transformer, lorsque pertinent, en tests de conformité de la toolchain.