Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update integers.md to mention Int128 and UInt128 #361

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion syntax_and_semantics/literals/integers.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Integers

There are four signed integer types, and four unsigned integer types:
There are five signed integer types, and five unsigned integer types:

Type | Length | Minimum Value | Maximum Value
---------- | -----------: | -----------: |-----------:
[Int8](http://crystal-lang.org/api/Int8.html) | 8 | -128 | 127
[Int16](http://crystal-lang.org/api/Int16.html) | 16 | −32,768 | 32,767
[Int32](http://crystal-lang.org/api/Int32.html) | 32 | −2,147,483,648 | 2,147,483,647
[Int64](http://crystal-lang.org/api/Int64.html) | 64 | −2<sup>63</sup> | 2<sup>63</sup> - 1
[Int128](http://crystal-lang.org/api/Int64.html) | 128 | −2<sup>127</sup> | 2<sup>127</sup> - 1
[UInt8](http://crystal-lang.org/api/UInt8.html) | 8 | 0 | 255
[UInt16](http://crystal-lang.org/api/UInt16.html) | 16 | 0 | 65,535
[UInt32](http://crystal-lang.org/api/UInt32.html) | 32 | 0 | 4,294,967,295
[UInt64](http://crystal-lang.org/api/UInt64.html) | 64 | 0 | 2<sup>64</sup> - 1
[UInt128](http://crystal-lang.org/api/UInt64.html) | 128 | 0 | 2<sup>128</sup> - 1

An integer literal is an optional `+` or `-` sign, followed by
a sequence of digits and underscores, optionally followed by a suffix.
Expand All @@ -25,11 +27,13 @@ in which the number fits:
1_i16 # Int16
1_i32 # Int32
1_i64 # Int64
1_i128 # Int128

1_u8 # UInt8
1_u16 # UInt16
1_u32 # UInt32
1_u64 # UInt64
1_u128 # UInt128

+10 # Int32
-20 # Int32
Expand Down