4 ms·
F# units of measure to the rescue: https://msdn.microsoft.com/en-us/library/dd233243.aspx https://msdn.microsoft.com/en-us/library/dd233243.aspx let convertCt
by _random_ 11y ago
F# units of measure to the rescue:
https://msdn.microsoft.com/en-us/library/dd233243.aspx https://msdn.microsoft.com/en-us/library/dd233243.aspx
let convertCtoF ( temp : float<degC> ) = 9.0<degF> / 5.0<degC> * temp + 32.0<degF>
- kvb 11y agoF# units can certainly handle the problem given a fixed matrix size, but for a general method handling arbitrary dimensions you'd need variadic measure arguments, which aren't supported (and would probably require quite a bit of bookkeeping for this particular problem, in any language).