Open mgrossmann opened 4 years ago
Hello from https://github.com/adesutherland/CMS-370-BREXX !
Format is one of the built in functions which fails most terribly in our test suite - and I am thinking of porting Regina's implementation to BREXX (which may mean making a new maths implementation too ... troublesome but probably also a good thing).
Is this a sub-project that we can jointly look at?
Hello Adrian,
we can definitely imagine working together. It doesn't make much sense to develop everything two or three times.
Mike
With a test case supplied by Walter Pachl, the difference between BREXX on MVS and CMS can be shown:
/* */
PARSE VERSION V
SAY V
_=" -0.05625000000000000000"
SAY '_='_
SAY 'FORMAT(_/1, 6)' FORMAT(_/1, 6)
SAY 'FORMAT(_+0, 6)' FORMAT(_+0, 6)
SAY 'FORMAT(_ , 6)' FORMAT(_ , 6)
_=" 0.05625000000000000000"
SAY 'FORMAT(_/1, 6)' FORMAT(_/1, 6)
SAY 'FORMAT(_+0, 6)' FORMAT(_+0, 6)
SAY 'FORMAT(_ , 6)' FORMAT(_ , 6)
output on MVSTK5:
BREXX/370 V2R5M2 (Mar 02 2023)
_= -0.05625000000000000000
FORMAT(_/1, 6) -0.0
FORMAT(_+0, 6) -0.0
FORMAT(_ , 6) -0.0
FORMAT(_/1, 6) 0.0
FORMAT(_+0, 6) 0.0
FORMAT(_ , 6) 0.0
output on VM/370CE:
CMS bREXX 1.0.1 Jul 5 2022
_= -0.05625000000000000000
FORMAT(_/1, 6) -0.05625
FORMAT(_+0, 6) -0.05625
FORMAT(_ , 6) -0.05625
FORMAT(_/1, 6) 0.05625
FORMAT(_+0, 6) 0.05625
FORMAT(_ , 6) 0.05625
expected output:
REXX370 4.02 01 Dec 1998
_= -0.05625000000000000000
format(_/1, 6) -0.05625
format(_+0, 6) -0.0562500000
format(_ , 6) -0.0562500000
format(_/1, 6) 0.05625
format(_+0, 6) 0.0562500000
format(_ , 6) 0.0562500000
The BRexx/370 FORMAT function, by definition under the Math functions documentation, is not the standard version of the Rexx FORMAT Built-in-Function as demonstrated in the BRexx documentation on FORMAT():
I recommend for Rexx platform portability’s sake, that eventually, we do like what was done with the STORAGE() BiF, re-establishing the current FORMAT() BiF as BFORMAT and implementing the FORMAT() BiF as a Rexx standard FORMAT() BiF. I believe that I ran across a RexxFormat() external function somewhere that looked like it might fit the bill and provide the standard Rexx FORMAT() BiF functionality. Oh yes, I did find it in the BRexx distribution, a RxLib external function called RexxFormat(). However, it is not fully flushed out and is not operational at this time. It’s probably 70% complete and eventually could become the standard (although external) version of the FORMAT() function for BRexx/370 with not too significant of an effort ...