I just noticed this simple performance improvement that's likely to have a huge performance impact on the NumberExtensions..
public static Mass Centigrams<T>(this T value)
where T : notnull
#if NET7_0_OR_GREATER
, INumber<T>
=> Mass.FromCentigrams(double.CreateChecked(value));
#else
=> Mass.FromCentigrams(Convert.ToDouble(value));
#endif
Not sure if we want this in v5, v6 or I could just put it up-for-grabs and leave it for later..
Note that there is probably a Convert.ToDecimal somewhere, just waiting to popup as a merge conflict...
I just noticed this simple performance improvement that's likely to have a huge performance impact on the
NumberExtensions..Not sure if we want this in
v5,v6or I could just put itup-for-grabsand leave it for later..Note that there is probably a
Convert.ToDecimalsomewhere, just waiting to popup as a merge conflict...