-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
api-needs-workAPI needs work before it is approved, it is NOT ready for implementationAPI needs work before it is approved, it is NOT ready for implementationarea-System.Numerics
Milestone
Description
the current version of the API requires 2 rounding operations to convert from a double to a decimal with n places of precision.
eg
double d = ...;
decimal m1 = (decimal)d; // first rounding operation
decimal m2 = Math.Round(m1, n, MidpointRounding.AwayFromZero); // second rounding operation
ideally we would have an API that allows a direct conversion/round in a single operation:
in class Decimal:
public static decimal Round(double d, int n, MidpointRounding rouding) {}
this is both for performance and correctness reasons. rounding twice may introduce inaccuracies (albeit subtle and infrequent) and also inccurs an extra unnecessary step.
scalablecory
Metadata
Metadata
Assignees
Labels
api-needs-workAPI needs work before it is approved, it is NOT ready for implementationAPI needs work before it is approved, it is NOT ready for implementationarea-System.Numerics