Skip to content

Commit

Permalink
WIP: isolate double free bug in dd::to_string
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravenwater committed Aug 19, 2024
1 parent d64a701 commit df6783a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions static/dd/api/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ namespace sw {
for (dd from = start, to, delta;
(delta = (to = nextafter(from, +INFINITY)) - from) < 10.0;
from *= 10.0) {
dd u = ulp(from);
std::cout << "ulp(" << std::scientific << std::setprecision(0) << from
<< ") gives " << to_binary(ulp(from)) << " : "
<< std::fixed << std::setprecision(6) << ulp(from) << '\n';
<< ") gives " << to_binary(u) << " : "
<< /*std::fixed <<*/ std::setprecision(6) << u
<< '\n';
}
}
}
Expand Down Expand Up @@ -361,13 +363,7 @@ try {

std::cout << "---------- Unit in the Last Place --------+\n";
{
dd a{ 1.0 };

ulp_progression("\nULP progression for dd:\n", dd(10.0));

using float_type = ::std::enable_if< ::std::is_floating_point<float>::value, float >::type;
using double_type = ::std::enable_if< ::std::is_floating_point<double>::value, double >::type;
// using bla = ::std::enable_if< ::std::is_floating_point<int>::value, int >::type
}

std::cout << "+--------- numeric_limits of double-double vs IEEE-754 --------+\n";
Expand Down

0 comments on commit df6783a

Please sign in to comment.