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

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

[Octave-bug-tracker] [bug #64607] [octave forge] (interval)


From: Vincent Lefèvre
Subject: [Octave-bug-tracker] [bug #64607] [octave forge] (interval)
Date: Tue, 29 Aug 2023 03:48:46 -0400 (EDT)

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

                 Summary: [octave forge] (interval)
                   Group: GNU Octave
               Submitter: vinc17
               Submitted: mar. 29 août 2023 07:48:44
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: other
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: mar. 29 août 2023 07:48:44    By: Vincent Lefèvre <vinc17>
With the interval 3.2.1 package,
https://ci.debian.net/data/autopkgtest/testing/amd64/o/octave-interval/37232402/log.gz
shows 2 failures with GNU MPFR 4.2.1:

165s ***** assert (intervaltotext (infsup (-inf, inf), "[<g]"), "[-inf,
inf]");
165s !!!!! test failed
165s ASSERT errors for:  assert (intervaltotext (infsup (-inf, inf),
"[<g]"),"[-inf, inf]")

and

165s ***** assert (intervaltotext (infsup (-inf, inf), "[<F]"), "[-INF,
INF]");
165s !!!!! test failed
165s ASSERT errors for:  assert (intervaltotext (infsup (-inf, inf),
"[<F]"),"[-INF, INF]")

This is due to a fix of a bug in the MPFR formatted functions: the "+" flag
was ignored for Inf and NaN, and it is now honored like in the C formatted
functions (the MPFR documentation was contradictory on this point).
Octave-interval seems to use this flag in this case:

src/intervaltotext.cc contains

      case INF_SUP:
        {
          bool
          force_sign = (layout.display_plus == ALWAYS ||
              (layout.display_plus == INNER_ZERO && inf < 0.0 && 0.0 < sup));
          l = double_to_string (layout, stat, force_sign, inf, MPFR_RNDD);
          u = double_to_string (layout, stat, force_sign, sup, MPFR_RNDU);
        }
        break;

(INNER_ZERO is the default, and inf < 0.0 && 0.0 < sup is true, and
double_to_string eventually calls mpfr_sprintf).

BTW, https://octave.sourceforge.io/interval/function/intervaltotext.html says

  <
    Output Entire as [-Inf, +Inf] instead of [Entire]

with a sign for both Inf. So, with the MPFR fix, Octave-interval will behave
as expected. It is just the test that is now wrong. The expected string should
be "[-inf, +inf]" and "[-INF, +INF]" respectively.







    _______________________________________________________

Reply to this item at:

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

_______________________________________________
Message posté via Savannah
https://savannah.gnu.org/




reply via email to

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