2 ms·
This discussion reminds me that F# has units of measure support in the language. For example constants can be annotated with units[1]: 1.0<cm> 55.0<mi
by kristianp 4y ago
This discussion reminds me that F# has units of measure support in the language. For example constants can be annotated with units[1]:
1.0<cm>
55.0<miles/hour>
Tangentially, it also reminds me that some popular languages don't have a binary coded decimal type for example go and java(?). C# and standard sql support decimals, so your $1.02 doesn't get approximated as $1.01999999
Go has at least 25 community decimal packages[2], but who knows which is a good one to use.
[1] https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/units-of-measure https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...
[2] https://pkg.go.dev/search?q=decimal&m= https://pkg.go.dev/search?q=decimal&m=