What is the best type to store area, volume, perimeter? [duplicate]

4

Decimal , Numeric or Float . What is the best option to store area or volume? I would use Decimal, but I would like to see the views of others as well. It does not seem like it, but the right kind or the closest of that makes all the difference, even because I caught up with a bank with types REAL and I do not want to waste time with wrong types. I used since I will map the bank types through C # .

    
asked by anonymous 21.11.2017 / 17:56

1 answer

7

In general the decimal is the most correct. Even if you do not need the accuracy in it to interact with other units that need the bad, it contaminates the good and everything goes wrong.

In general I see zero advantages in using a binary floating-point type . Yes, it has more performance and should take up less memory, but the risk is very high, especially in the hands of programmers who are not very keen on software development and do everything in depth with all the consequences. And everything is absurdly well documented, which never happens.

See more at What is the correct way to use float, double, and decimal types? .

    
21.11.2017 / 18:01