mvslovers / brexx370

MVS version of Vasilis Vlachoudis awesome rexx implementation
46 stars 11 forks source link

TRUNC() for decimal numbers cuts off at wrong decimal position #44

Closed Peter-Jacob closed 5 years ago

Peter-Jacob commented 5 years ago

not true, withdraw and closed!

Peter-Jacob commented 5 years ago

TRUNC truncates incorrectly if the number of decimal positions is the same as the requested cut off position. Example: say trunc('123.58',2) -> returns 123.5 instead 123.58
say trunc('-123.581',2) -> returns -123.58 which is correct.

Peter-Jacob commented 5 years ago

If the decimal precision is the same as the requested decimal places of trunc, it cuts off one decimal place too much: TRUNC(123.58,2) -> 123.5 TUNC(123.5800,2) -> 123.5 even if there are trailing 0's padded to the decimal places. It seems trailing 0's are immediately dropped, so the number stored is 123.58 not 123.5800

Peter-Jacob commented 5 years ago

The problem has been resolved by replacement module in the C-Compiler

Peter-Jacob commented 5 years ago

Issue closed