Hi,
I'm writing a BMR function, should I be using a decimal type as my return value for highest percision? (C#)
Hi,
I'm writing a BMR function, should I be using a decimal type as my return value for highest percision? (C#)
Assuming you mean the basal metabolic rate, I'd use double. We're talking about natural quantities here which don't have discrete values - we might say that something weighs 10.25kg for example, but that's already an estimate. It's not like currency, where $10.25 is exactly that amount of money.
I reckon a reasonable rule of thumb is "double for science, decimal for finance" - but it's not an absolute rule, obviously.