Open TheFausap opened 7 months ago
This is to be expected. From the manual (BREXX370_Users_Guide_V2R5M2.pdf):
BREXX supports two numeric types: Integer
Integers are stored in 4 bytes a full word (LONG), this means their range is from -2,147,483,648 to +2,147,483,647
Decimal Numbers Decimal Numbers (decimal numbers with a fractional part) are represented in the double-precision floating- point format (doubleword), the length is 8 bytes consisting of an exponent and the significand (fraction). It consists of 56 bits for the fraction part, a 7-bit exponent and one-bit for the sign. This representation is IBM- specific and differs slightly from the IIEE 754 floating-point standard. The precision of floating-point numbers is not as good as decimal packed numbers which are not supported in BREXX (nor in REXX). This means, for example, 2.0 might be stored as 19999999999999999e-17, or for 5.0 you will is stored as 50000000000000003e-17; this is not an error, but the usual behaviour for floating-point numbers. It is caused by the conversion between the numbers of base 10 to base two a bit-exact reversibility is not always given. This effect may build up during arithmetic calculations.
BREXX might or might not gain the unlimited decimal precision arithmetic; at the moment it does not have it.
Hello, I installed tk5 with the latest BREXX370 version. I suppose also this behaviour could be relate to the other open issue TRUNCATE ROUDING. The source is
I tried also with an online interpreter (https://www.tutorialspoint.com/execute_rexx_online.php), and I have the correct result