POV-Ray : Newsgroups : povray.off-topic : Funniest thing I read today : Re: Funniest thing I read today Server Time
11 Oct 2024 07:15:05 EDT (-0400)
  Re: Funniest thing I read today  
From: Darren New
Date: 12 Nov 2007 23:45:31
Message: <47392beb$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.