Re:Microsoft's Rust guide for C#/.NET developers
by kdowns on Friday March 15, 2024 @07:44PM
(#39721860)
Don't think that's quite right. `float` has 4 bytes, and `double` has 8. The `decimal` type has 16 bytes and does all it's arithmetic in base 10.
https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...
Re:Microsoft's Rust guide for C#/.NET developers
by pornel on Friday March 15, 2024 @06:28PM
(#39721349)
Are you quoting some old version? Because the page correctly states that Rust's f32 is C#'s float.
Re:Microsoft's Rust guide for C#/.NET developers
by jjtheblunt on Friday March 15, 2024 @07:35PM
(#39721800)
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.
Re:Microsoft's Rust guide for C#/.NET developers
by kcb on Friday March 15, 2024 @07:19PM
(#39721704)
That doesn't sound right.
Re:Microsoft's Rust guide for C#/.NET developers
by bloqs on Friday March 15, 2024 @08:46PM
(#39722253)
This smells like it was written by an LLM
Re:Microsoft's Rust guide for C#/.NET developers
by cqqxo4zV46cp on Saturday March 16, 2024 @12:15AM
(#39723344)
No it doesn’t.
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...