Given 2 values like so:
decimal a = 0.15m;
decimal b = 0.85m;
Where a + b
will always be 1.0m
, both values are only specified to 2 decimal places and both values are >= 0.0m
and <= 1.0m
Is it guaranteed that x == total
will always be true, for all possible Decimal values of x
, a
and b
? Using the calculation below:
decimal x = 105.99m;
decimal total = (x * a) + (x * b);
Or are there cases where x == total
only to 2 decimal places, but not beyond that?
Would it make any difference if a
and b
could be specified to unlimited decimal places (as much as Decimal
allows), but as long as a + b = 1.0m
still holds?