Skip to content

Commit 24a6cae

Browse files
committed
debug findRoot windows numeric bug
1 parent 45d7b7e commit 24a6cae

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/mir/numeric.d

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,13 +606,15 @@ version(mir_test) @safe unittest
606606
int numProblems = 0;
607607
int numCalls;
608608

609-
void testFindRoot(real delegate(real) @nogc @safe nothrow pure f , real x1, real x2) //@nogc @safe nothrow pure
609+
void testFindRoot(real delegate(real) @nogc @safe nothrow pure f , real x1, real x2, int line = __LINE__) //@nogc @safe nothrow pure
610610
{
611611
//numCalls=0;
612612
//++numProblems;
613613
assert(x1 == x1 && x2 == x2);
614-
assert(f(x1).signbit != f(x2).signbit);
615-
auto result = findRoot!f(x1, x2, f(x1), f(x2)).validate;
614+
auto result = findRoot!f(x1, x2);
615+
616+
import std.conv: to;
617+
assert(result.status == FindRootStatus.success, line.to!string);
616618

617619
auto flo = f(result.ax);
618620
auto fhi = f(result.bx);

0 commit comments

Comments
 (0)