bugGNU Octave - Bugs: bug #64607, [octave forge] (interval) two test...

 
 

bug #64607: [octave forge] (interval) two test failures about [-inf, inf]

Submitter:  Vincent Lefèvre <vinc17>
Submitted:  Tue 29 Aug 2023 07:48:44 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * other Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 29 Aug 2023 07:52:18 AM UTC, comment #1: 

Oops, I don't know how to edit the bug title (I forgot to complete it). It should be something like "[octave forge] (interval) 2 test failures about [-inf, inf]".

Vincent Lefèvre <vinc17>
Tue 29 Aug 2023 07:48:44 AM UTC, original submission:  

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.

Vincent Lefèvre <vinc17>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by vinc17 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-08-29 mmuetzel Carbon-CopyRemoved 102357 -
    2023-08-29 mmuetzel Summary[octave forge] (interval) [octave forge] (interval) two test failures about [-inf, inf]

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code