octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61844] Incorrect number of digits printed by


From: anonymous
Subject: [Octave-bug-tracker] [bug #61844] Incorrect number of digits printed by printf for "%20.15g" and "%20.17g"
Date: Mon, 17 Jan 2022 13:13:25 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 Edg/97.0.1072.55

URL:
  <https://savannah.gnu.org/bugs/?61844>

                 Summary: Incorrect number of digits printed by printf for
"%20.15g" and "%20.17g" 
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Mon 17 Jan 2022 06:13:23 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Inaccurate Result
                  Status: None
             Assigned to: None
         Originator Name: János Maros
        Originator Email: jmaros@t-online.hu
             Open/Closed: Open
                 Release: 6.1.0
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

GNU Octave, version 6.1.0
Octave was configured for "x86_64-w64-mingw32".

>> printf("%20.00g",100/31)
                   3>> printf("%20.02g",100/31)
                 3.2>> printf("%20.03g",100/31)
                3.23>> printf("%20.04g",100/31)
               3.226>> printf("%20.05g",100/31)
              3.2258>> printf("%20.06g",100/31)
             3.22581>> printf("%20.07g",100/31)
            3.225806>> printf("%20.08g",100/31)
           3.2258065>> printf("%20.09g",100/31)
          3.22580645>> printf("%20.10g",100/31)
         3.225806452>> printf("%20.11g",100/31)
        3.2258064516>> printf("%20.12g",100/31)
       3.22580645161>> printf("%20.13g",100/31)
      3.225806451613>> printf("%20.14g",100/31)
     3.2258064516129>> printf("%20.15g",100/31)
     3.2258064516129>> printf("%20.16g",100/31)
   3.225806451612903>> printf("%20.17g",100/31)
   3.225806451612903>> printf("%20.18g",100/31)
 3.22580645161290303>> printf("%20.19g",100/31)
3.225806451612903025>> printf("%20.20g",100/31)
3.2258064516129030253>> printf("%20.21g",100/31)
3.22580645161290302525>>
>>
>> printf("%17.00g",100/31)
                3>> printf("%17.01g",100/31)
                3>> printf("%17.02g",100/31)
              3.2>> printf("%17.03g",100/31)
             3.23>> printf("%17.04g",100/31)
            3.226>> printf("%17.05g",100/31)
           3.2258>> printf("%17.06g",100/31)
          3.22581>> printf("%17.07g",100/31)
         3.225806>> printf("%17.08g",100/31)
        3.2258065>> printf("%17.09g",100/31)
       3.22580645>> printf("%17.10g",100/31)
      3.225806452>> printf("%17.11g",100/31)
     3.2258064516>> printf("%17.12g",100/31)
    3.22580645161>> printf("%17.13g",100/31)
   3.225806451613>> printf("%17.14g",100/31)
  3.2258064516129>> printf("%17.15g",100/31)
  3.2258064516129>> printf("%17.16g",100/31)
3.225806451612903>> printf("%17.17g",100/31)
3.225806451612903>> printf("%17.18g",100/31)
3.22580645161290303>> printf("%17.19g",100/31)
3.225806451612903025>> printf("%17.20g",100/31)
3.2258064516129030253>> printf("%17.21g",100/31)




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61844>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]