On 9/22/25 3:30 AM, Andreas Schwab wrote:
On Sep 22 2025, Duncan Roe via Bug reports for the GNU Bourne Again SHell wrote:

$ printf '%g\n' $(fltexpr -p '0.1 + 0.2')
0.3

That is wrong for a value that needs more than 6 digits of precision.

Salt to taste. '%.15g' would address the OP's requirements.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

  • Re: About fltexp... pourko--- via Bug reports for the GNU Bourne Again SHell
    • Re: About f... Oğuz
      • Re: Abo... pourko--- via Bug reports for the GNU Bourne Again SHell
        • Re:... Duncan Roe via Bug reports for the GNU Bourne Again SHell
          • ... pourko--- via Bug reports for the GNU Bourne Again SHell
            • ... Duncan Roe via Bug reports for the GNU Bourne Again SHell
            • ... pourko--- via Bug reports for the GNU Bourne Again SHell
            • ... Duncan Roe via Bug reports for the GNU Bourne Again SHell
            • ... Andreas Schwab
            • ... Chet Ramey
    • Re: About f... Andreas Schwab
  • Re: About fltexp... pourko--- via Bug reports for the GNU Bourne Again SHell
    • Re: About f... Lawrence Velázquez
      • Re: Abo... pourko--- via Bug reports for the GNU Bourne Again SHell
        • Re:... Lawrence Velázquez
          • ... pourko--- via Bug reports for the GNU Bourne Again SHell
            • ... Lawrence Velázquez
            • ... pourko--- via Bug reports for the GNU Bourne Again SHell
            • ... Chet Ramey
    • Re: About f... Greg Wooledge

Reply via email to