4 ms·
"Decimal" is not floating point... On the contrary, it's fixed point, as you set fixed amount of precision both before and after the decimal point. More importa
by burntoutfire 6y ago
"Decimal" is not floating point... On the contrary, it's fixed point, as you set fixed amount of precision both before and after the decimal point. More importantly, "decimal" does not suffer from the arithmetic issues you get when using IEEE 754 floating point.
- nurettin 6y agoyes, what is your point?
- rini17 6y agoThat you aren't using floating point.
- nurettin 6y agoDouble precision isn't floating point? I'm not sure that's his point.
- rini17 6y agoDouble precision is FP, Decimal is not FP. Your software might confuse these two, but that notion isn't supported by computer science.
- nurettin 6y agoI didn't say decimal is floating point, I said I used decimal for db. Not to confuse what I use for the rest of the software. And the persons replying assumed that I had no idea about what I'm doing. Which isn't really nice. Anyway I will break off the reply train here. Hope someone gets educated reading this thread so all those "nice" replies don't go to waste.
- deleted 6y ago[deleted]
- stronglikedan 6y ago> And the persons replying assumed that I had no idea about what I'm doing. Which isn't really nice. This is simply not true. Your original response strongly implied that you were confusing decimal with floating point. If you reread your original reply strictly in the context of the original comment, you may notice what I'm talking about. The responses were just pointing out the difference, and doing so quite nicely I might add.
- deleted 6y ago[deleted]
- Twirrim 6y agoThis is one of those cases where your reality was not successfully communicated in your message. Your original message, in the context in which it was presented, fairly clearly implied that you thought floating point and decimal are the same thing. That might not be the intent, or the reality, but it's what you managed to convey. Hence the thread.
- shultays 6y agoI don't know about databases but if that decimal is the decimal I know of, it is not a floating point number. In decimal you specify how many bits will be used for decimal & non-decimal parts. If your unsigned decimal has 1 bit for non-decimal and 1 bit for decimal, then it can only store: 0.0 0.5 1.0 1.5. 1 bit for non-decimal gives you either 0 or 1 and 1 bit for decimal gives you .0 or .5. In many ways a decimal is just an integer, except the printing & some math operations being different In floating point, you are also storing "exponent" which represents where the point goes. So the point actually "floats" depending on value of this exponent while in fixed point the point is fixed (and in previous example, the point is always in between those two bits. The implementation is a bit harder to explain, you can check it here: https://www.doc.ic.ac.uk/~eedwards/compsys/float/ https://www.doc.ic.ac.uk/~eedwards/compsys/float/
- josefx 6y ago> More importantly, "decimal" does not suffer from the arithmetic issues you get when using IEEE 754 floating point. It can represent represent 1/10 correctly, it can represent 1/2 correctly (so can float), how about 1/3? Outside of a few happy coincidences you are back to the same old issues.