Hacker News new | past | comments | ask | show | jobs | submit login

I'd like to point out that COBOL generates rather efficient fixed-point math code on IBM mainframes because those mainframes have a dedicated set of machine-level instructions that deal with fixed-point math.

The data type used is "Packed Decimal" where each nybble in a string of bytes represents a digit, except the last nybble. The last nybble describes the sign of the overall number. It's similar to BCD with a sign-nybble at the end.

Here's a list of the Packed Decimal instructions with a description of each.

http://faculty.cs.niu.edu/~byrnes/csci360/notes/360pack.htm




X86 used to have BCD instructions but they were killed in X64.


Interesting, but I assume those machines are dead?


No, these instructions are still present in IBM's z/Architecture.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: