-
Notifications
You must be signed in to change notification settings - Fork 400
Closed
Labels
enhancementpinnedIssues that should not be auto-closed due to inactivity.Issues that should not be auto-closed due to inactivity.
Description
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...
Metadata
Metadata
Assignees
Labels
enhancementpinnedIssues that should not be auto-closed due to inactivity.Issues that should not be auto-closed due to inactivity.