I am writing a mathematical function to provide the volume of a cube in order to get the total weight of an object where the weight per square inch is 0.28361111111111109
(stored as constant double) this is obviously a very specific and precise number.
Back to the question though, is it any more difficult to compute an equation with this number as opposed to a rounded version of something like 0.28461
or is there basically no difference in the way a computer handles the computation?
Precision is ideal, but not at the cost of performance.
This applies for me more specifically to the .NET framework, but it possibly applies more generally to programming.
For what it's worth the code in particular is:
public var Weight
{
get
{
double weight_per_square_inch = 0.28361111111111109;
double volume = this.Length * this.Thickness * this.Width;
return (volume * weight_per_square_inch) * this.Quantity;
}
}