|
|
Alain wrote:
> COBOL, maybe the only computer language where the internal
> representation for numbers is a formated string!
Well, only if you told it to. You had binary numbers, bcd numbers,
packed bcd numbers, and "display" numbers, which is what you're talking
about.
Actually, the first mainframe I used had an optional "scientific unit"
(aka "floating point processor") and an optional "business unit" (aka
string-processing processor). The latter had instructions like block
move, BCD math, and (get this) an instruction that took a packed BCD
number pointed to by one register and a COBOL display formatting string
pointed to by the other register and formatted the number into the space
pointed to by a third register, all in one instruction, with floating $,
leading zero suppression, putting () around negative values, and everything.
> It would have been so much simpler to store all numbers and dates as
> binary, with input/output formating filters...
Usually that's what happened. Where people did calculations with the
numbers, they used COMP or DECIMAL numbers. Where they printed them,
they used DISPLAY numbers.
> The peoples who created that must have been crazy! At the time, RAM and
> storage where at a premium, and you waste precious memory to store
> EVERYTHING as strings... Not to mention that doing arithmetics on
> strings is prety slow.
You never actually programmed anything in COBOL, did you?
--
Darren New / San Diego, CA, USA (PST)
Remember the good old days, when we
used to complain about cryptography
being export-restricted?
Post a reply to this message
|
|