PL/I

PL/I

PL/I

 View Only
Expand all | Collapse all

Help on conversion of Binary Float to Decimal Float

  • 1.  Help on conversion of Binary Float to Decimal Float

    Posted Fri March 09, 2012 12:53 PM
    We are facing precision issues as we are having Binary FLoat datatypes declared in our program . Are the utilities to automatically convert the code or compiler options to convert this to Decimal Float          - regards Pavan
    PavankumarM


  • 2.  Re: Help on conversion of Binary Float to Decimal Float

    Posted Thu December 13, 2012 07:29 PM
     You specify precision in binary as: FLOAT BINARY (n)
    where the constant n is the (minimum) number of binary digits that you want in the mantissa.
    If you specified just FLOAT BINARY you will get default precision (one word)
    or about 21 binary digits for hexadecimal floating-point.
    You can get up to 53 binary digits.
     
    For the PC (IEEE float), you have  up to 64 binary digits.
     
    By specifying FLOAT or FLOAT(m) you will get either float binary or decimal,
    depending on the compiler. In this case, m is the number of decimal digits of
    precision that you want.  e.g., FLOAT (18) gives 64 binary digits on the PC (IEEE float).
    Just FLOAT by itself gives default precision.
     
    Robin500