Re:Understanding the x86's Decimal Adjust after Addition (DA...
by TazeTSchnitzel on Tuesday January 31, 2023 @05:25AM
(#34593465)
The confusion around 0.1 might be a good thing, it makes you learn early on that floats approximate a number to its significant digits and are not real numbers.
[ Parent
| on HN ]
Re:Understanding the x86's Decimal Adjust after Addition (DA...
by wheybags on Tuesday January 31, 2023 @06:47AM
(#34593940)
People are used to approximations, but they are used to decimal approximations. "I can't represent 1/3 as a decimal" is expected, "I can't represent 1/10 as a decimal" is surprising.
Re:Understanding the x86's Decimal Adjust after Addition (DA...
by DerekL on Tuesday January 31, 2023 @04:59PM
(#34602867)
Making computers use more memory, use larger chips, and consume more power just to make one thing easier for novice programmers is a bad trade-off. Decimal floating-point types could be implemented in software for those who really want it.
Re:Understanding the x86's Decimal Adjust after Addition (DA...
by bcrl on Wednesday February 01, 2023 @08:26PM
(#34620792)
By that reasoning we shouldn't be using higher level languages like Python and Java that use more memory, and consume more power for the same workload as code written in assembly. 6502 assembly FTW!
Re:Understanding the x86's Decimal Adjust after Addition (DA...
by CamperBob2 on Tuesday January 31, 2023 @11:15AM
(#34597069)
Well, they are real numbers, just not always the ones you want.