Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Monday September 16 2019, @01:48PM   Printer-friendly
from the COBOL-is-often-fractionally-better dept.

https://medium.com/@bellmar/is-cobol-holding-you-hostage-with-math-5498c0eb428b

Face it: nobody likes fractions, not even computers.

When we talk about COBOL the first question on everyone's mind is always Why are we still using it in so many critical places? Banks are still running COBOL, close to 7% of the GDP is dependent on COBOL in the form of payments from the Centers for Medicare & Medicaid Services, The IRS famously still uses COBOL, airlines still use COBOL (Adam Fletcher dropped my favorite fun fact on this topic in his Systems We Love talk: the reservation number on your ticket used to be just a pointer), lots of critical infrastructure both in the private and public sector still runs on COBOL.

Why?

The traditional answer is deeply cynical. Organizations are lazy, incompetent, stupid. They are cheap: unwilling to invest the money needed upfront to rewrite the whole system in something modern. Overall we assume that the reason so much of civil society runs on COBOL is a combination of inertia and shortsightedness. And certainly there is a little truth there. Rewriting a mass of spaghetti code is no small task. It is expensive. It is difficult. And if the existing software seems to be working fine there might be little incentive to invest in the project.

But back when I was working with the IRS the old COBOL developers used to tell me: "We tried to rewrite the code in Java and Java couldn't do the calculations right."

[Ed note: The referenced article is extremely readable and clearly explains the differences between floating-point and fixed-point math, as well as providing an example and explanation that clearly shows the tradeoffs.]


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by gtomorrow on Tuesday September 17 2019, @04:47AM (2 children)

    by gtomorrow (2230) on Tuesday September 17 2019, @04:47AM (#894998)

    IT'S TRUE!!! Why???

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 3, Interesting) by FatPhil on Tuesday September 17 2019, @08:19AM

    by FatPhil (863) <{pc-soylent} {at} {asdf.fi}> on Tuesday September 17 2019, @08:19AM (#895072) Homepage
    Subtraction of similar sized values always introduces imprecisions in floating point if one of the values is only an approximation to the value you really want to represent. The top bits have cancelled out, and the remaining value is shifted left so that it's again validly represented as a floating point number. There's nothing to do except shift in 0s at the bottom. If your representation for 2.19 was actually a very slight under-approximation (because you're using a binary representation), then the final result will be a bigger under-approximation. If your representation for 2.19 was actually a very slight over-approximation, then the final result will be a bigger over-approximation (despite shifting in 0s - the over-approximation has been scaled up, and that's where the inaccuracy lies).
    --
    Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
  • (Score: 2) by legont on Wednesday September 18 2019, @01:26AM

    by legont (4179) on Wednesday September 18 2019, @01:26AM (#895456)

    Cause kids don't know how to solve problems solved half a century ago?

    Another example would be *nix having persistent issue with "large" number of files in a directory. The result of an investigation is usually a scraching heads and the question: "hold on, mainframe does not have directories. How did they manage to have unlimited number of files in the root back in 60s".

    --
    "Wealth is the relentless enemy of understanding" - John Kenneth Galbraith.