10 comments

[ 2.5 ms ] story [ 34.6 ms ] thread
(comment deleted)
f16 in Rust is equivalent to float in C#

f32 in Rust is equivalent to double in C#

f64 in Rust is equivalent to decimal in C#

correcting a typo on this page:

https://microsoft.github.io/rust-for-dotnet-devs/latest/lang...

Are you quoting some old version? Because the page correctly states that Rust's f32 is C#'s float.
That doesn't sound right.
Where are you getting what you wrote?

Rust doesn't (March 2024) have f16. And the other correspondences you wrote are wrong.

There's a crate (several it seems) which realizes an f16 with arithmetic using u16, for example.

Having never touched rust before, this seems like a good launching point. Curious though - why did Microsoft create this? Presumably they would be more interested in a C#/.NET guide for Rust developers.
Microsoft employs a number of people writing Rust code, with more on the way. I don’t have specific context as to why this guide was created, but it’s not like .NET languages are the only languages used at Microsoft.