my ziglings
0

Configure Feed

Select the types of activity you want to include in your feed.

Fixed unicode literal

Chris Boesch (Mar 8, 2024, 1:07 AM +0100) d0519d18 9e9cf404

+6 -6
+6 -6
exercises/059_integers.zig
··· 2 2 // Zig lets you express integer literals in several convenient 3 3 // formats. These are all the same value: 4 4 // 5 - // const a1: u8 = 65; // decimal 6 - // const a2: u8 = 0x41; // hexadecimal 7 - // const a3: u8 = 0o101; // octal 8 - // const a4: u8 = 0b1000001; // binary 9 - // const a5: u8 = 'A'; // ASCII code point literal 10 - // const a6: u16 = 'Ȁ'; // Unicode code points can take up to 21 bits 5 + // const a1: u8 = 65; // decimal 6 + // const a2: u8 = 0x41; // hexadecimal 7 + // const a3: u8 = 0o101; // octal 8 + // const a4: u8 = 0b1000001; // binary 9 + // const a5: u8 = 'A'; // ASCII code point literal 10 + // const a6: u16 = '\u{0041}'; // Unicode code points can take up to 21 bits 11 11 // 12 12 // You can also place underscores in numbers to aid readability: 13 13 //