Skip to content

Commit df6783a

Browse files
committed
WIP: isolate double free bug in dd::to_string
1 parent d64a701 commit df6783a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

static/dd/api/api.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ namespace sw {
104104
for (dd from = start, to, delta;
105105
(delta = (to = nextafter(from, +INFINITY)) - from) < 10.0;
106106
from *= 10.0) {
107+
dd u = ulp(from);
107108
std::cout << "ulp(" << std::scientific << std::setprecision(0) << from
108-
<< ") gives " << to_binary(ulp(from)) << " : "
109-
<< std::fixed << std::setprecision(6) << ulp(from) << '\n';
109+
<< ") gives " << to_binary(u) << " : "
110+
<< /*std::fixed <<*/ std::setprecision(6) << u
111+
<< '\n';
110112
}
111113
}
112114
}
@@ -361,13 +363,7 @@ try {
361363

362364
std::cout << "---------- Unit in the Last Place --------+\n";
363365
{
364-
dd a{ 1.0 };
365-
366366
ulp_progression("\nULP progression for dd:\n", dd(10.0));
367-
368-
using float_type = ::std::enable_if< ::std::is_floating_point<float>::value, float >::type;
369-
using double_type = ::std::enable_if< ::std::is_floating_point<double>::value, double >::type;
370-
// using bla = ::std::enable_if< ::std::is_floating_point<int>::value, int >::type
371367
}
372368

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

0 commit comments

Comments
 (0)