PL/I

PL/I

PL/I

 View Only
  • 1.  Conversion of precisions of Fixed Bin

    Posted Thu March 30, 2017 07:24 AM

    If I have two variables under RULES(IBM) such that

    DCL a FIXED BIN(15);DCL b FIXED BIN(31);DCL c FIXED BIN(15);c = a/b;

    I know that the intermediate value for a/b is going to be Fixed Bin(31,16). However, I can't find how the truncation occurs to make it fit within a Fixed Bin (15) happens. I know that in some cases left truncation can occur to keep the decimal point in the correct place.

     

    If it helps, the number for a is 5370 and the number for b is 54.

     

    Thanks for your help!

    garbett1


  • 2.  Re: Conversion of precisions of Fixed Bin

    Posted Thu May 18, 2017 10:42 PM

    The fraction part is dropped upon assignment to C, which is declared as integer [ precision (15,0) ]

    Robin400