octave-maintainers
[Top][All Lists]
Advanced

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

Test failure for num2str.m


From: Daniel J Sebald
Subject: Test failure for num2str.m
Date: Thu, 06 Sep 2012 15:15:34 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

There is this test failure:

processing /usr/local/src/octave/octave/octave/scripts/general/num2str.m
  ***** xtest
 assert (num2str (1e23), "100000000000000000000000");
!!!!! known failure
assert (num2str (1e23),"100000000000000000000000") expected
100000000000000000000000
but got
99999999999999991611392

We know the issue, i.e., limitation of floating point numbers.

The question is, is this expected behavior? If so, I suggest altering the test so that it doesn't fail would be good. (Otherwise, the only fix is for the numeric class to store the string if it exceeds precision...which would be a ton of work.)

But what of this FIXME?

## FIXME: Integers greater than bitmax() should be masked to show just
##        16 digits of precision.
%!xtest
%! assert (num2str (1e23), "100000000000000000000000");

What is the point there?

Dan

PS: Why is num2str.m in the "general" subdirectory as opposed to the "strings" subdirectory?


reply via email to

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