Skip to content
Open
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
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ Let's look at some primitive types:

Both Rust and F# use postfixes on numbers to indicate the type if you want to choose something besides the default 32-bit int or 64-bit float. In Rust you can choose either declaring the type or adding a postfix, while in F# it's the postfix that does it. Thus:

* Rust `let x: u8 = 5` or `let x = 5u8` is F# `let x = 5uy`. (**u**nsigned b**y**te)
* Rust `let x: u16 = 5` or `let x = 5u16` is F# `let x = 5us`. (**u**nsigned **s**hort)
* Rust `let x: u32 = 5` or `let x = 5u32` is F# `let x = 5u`. (**u**nsigned)
* Rust `let x: u64 = 5` or `let x = 5u64` is F# `let x = 5UL`. (**U**nsigned **L**ong)
* Rust `let x: i8 = 5` or `let x = 5i8` is F# `let x = 5y`. (b**y**te)
* Rust `let x: i16 = 5` or `let x = 5i16` is F# `let x = 5s`. (**s**hort)
* Rust `let x: i32 = 5` or `let x = 5i32` is F# `let x = 5`. (no postfix here - it's the default)
* Rust `let x: i64 = 5` or `let x = 5i64` is F# `let x = 5L`. (**L**ong)
* Rust `let x: f32 = 5.0` or `let x = 5.0f32` is F# `let x = 5.0f` or `let x = 5f`.
* Rust `let x: f64 = 5.0` or `let x = 5.0f64` is F# `let x = 5.0`. (no postfix here - it's the default)
* Rust `let x: u8 = 5` or `let x = 5u8` is F# `let x = uint8 5` or `let x = 5uy`. (**u**nsigned b**y**te)
* Rust `let x: u16 = 5` or `let x = 5u16` is F# `let x = uint16 5` or `let x = 5us`. (**u**nsigned **s**hort)
* Rust `let x: u32 = 5` or `let x = 5u32` is F# `let x = uint32 5` or `let x = 5u`. (**u**nsigned)
* Rust `let x: u64 = 5` or `let x = 5u64` is F# `let x = uint64 5` or `let x = 5UL`. (**U**nsigned **L**ong)
* Rust `let x: i8 = 5` or `let x = 5i8` is F# `let x = int8 5` or `let x = 5y`. (b**y**te)
* Rust `let x: i16 = 5` or `let x = 5i16` is F# `let x = int16 5` or `let x = 5s`. (**s**hort)
* Rust `let x: i32 = 5` or `let x = 5i32` is F# `let x = int32 5` or `let x = 5`. (no postfix here - it's the default)
* Rust `let x: i64 = 5` or `let x = 5i64` is F# `let x = int64 5` or `let x = 5L`. (**L**ong)
* Rust `let x: f32 = 5.0` or `let x = 5.0f32` is F# `let x = float32 5` or `let x = 5.0f` or `let x = 5f`.
* Rust `let x: f64 = 5.0` or `let x = 5.0f64` is F# `let x = float 5` or `let x = 5.0`. (no postfix here - it's the default)

And both Rust and F# have the option of putting _ in between numbers to make them readable. This code works in both languages:

Expand Down