Page 1 of 1

Mainframe

Posted: Wed Sep 16, 2009 5:27 am
by nighthalk
this challenge doesnt seem to follow the IEEE-754 specifications, if you would note the two numbers -.22917763E-71 and .21482344E+74 have an exponential gap of 481 (in base 2), well above the 8 bit limit of 256, basically no matter what the bias is there is a floating point overflow that cant be stored in a single precision comp-1 decimal

and fyi, i STILL cant find a (free, working) compiler/interpreter for this thing that will take comp-1 (i found ones that dont support it blarg)

Posted: Wed Sep 16, 2009 7:26 am
by Nick-Aotmzgin
emule asnd torrent softwares?-> mainframe compiler/interpreter,
here-> http://www.google.com/search?hl=en&q=ma ... f&oq=&aqi=
Cobol Cinii
www.cobug.com/cobug/docs/compilers0030.html
ci.nii.ac.jp/naid/110002673529/en
www.mainframesindia.com/
good luck. :idea:

Posted: Wed Sep 16, 2009 11:12 am
by Zeta
you spotted a problem. Now the next questions you ask yourself are:
- What kind of mainframe is this program supposed to run on?
- How does it represent floating point numbers?

I'm not sure if there is a compiler which supports the needed floating point
representation if you can't let it run on the right hardware.

Posted: Wed Sep 16, 2009 6:06 pm
by megabreit
I think I can answer those questions. One is actually answered in the code.
- It's probably an IBM mainframe 370, but it doesn't matter!
- If you check the IBM Cobol documentation you'll notice there is the IEEE format and, guess what, IBM's own format (Remember: Cobol is 50 years old, and when it was created, there was nothing else).

If you look carefully enough, you'll find that IBM's format can describe bigger numbers than IEEE. But I could not yet find a description on how this format is translated into hex.

OpenCobol does not compile the code with some weird syntax error, other Cobol interpreters/compilers also did not succeed for me.

There are still some choices left:
- get mainframe access (unlikely)
- get a working Cobol interpreter/compiler which supports IBM COMP-1
- get the format description of IBM COMP-1 format and code the job barefoot

I keep trying...
Any other hint? :lol:

Posted: Thu Sep 17, 2009 1:09 am
by nighthalk
got it ^_^ it was a little flakey with the last bit (rounding?) but i managed to get enough to solve it in excel, you definatly have to watch out for what formats you use on that system

Posted: Thu Sep 17, 2009 7:21 am
by Nick-Aotmzgin
~~And it Solved~~

Posted: Fri Mar 19, 2010 8:32 pm
by jonik555
I'm doing it by hand. are all numbers usable? I used only those with small exponents and im getting answer Xxxx Xxx xx Xxx. I must probably try to somehow convert these ultra big resp. small values, am i right?