I'm looking for the equivalent of C# default
keyword, e.g:
public T GetNext() { T temp = default(T); ...
Thanks
Convert celsius to fahrenheit 1 Celsius is equal to 33.8 Fahrenheit.
If you find yourself needing to quickly convert Celsius to Fahrenheit, here is a simple trick you can use: multiply the temperature in degrees Celsius by 2, and then add 30 to get the (estimated) temperature in degrees Fahrenheit.
I found this in a blog: "What does this C# code look like in F#? (part one: expressions and statements)"
C# has an operator called "default" that returns the zero-initialization value of a given type:
default(int)
It has limited utility; most commonly you may use default(T) in a generic. F# has a similar construct as a library function:
Unchecked.defaultof<int>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With