logoalt Hacker News

adrian_b • today at 5:35 PM • 0 replies • view on HN

For many years, nobody has supported decimal numbers in hardware, except IBM (the deprecated instructions of Intel 8086 and 8087 do not count).

IBM has done this, despite it being an inferior technical solution, because it binds those who choose it to IBM hardware.

Programming currency operations with decimal floating-point numbers is easier for naive programmers.

Even on IBM mainframes, implementing currency operations using 64-bit or 128-bit integers is much faster and less resource-consuming than with decimal numbers, but the implementation of some of the operations can be a little tricky, when it must be guaranteed that no loss of precision may occur.

I think that I might have seen recently an announcement from someone else than IBM who has introduced hardware support for decimal floating-point numbers, perhaps from Fujitsu. In any case, whoever introduces such hardware support does it to lure some customers to migrate from IBM to them, and not because it were a good solution for implementing operations with money.