Skip to content
Snippets Groups Projects
Commit a77f2646 authored by Luigi Scarso's avatar Luigi Scarso
Browse files

fixed check interval for square root

parent 73c22674
Branches
No related tags found
No related merge requests found
......@@ -161,6 +161,7 @@ static int mpfi_remainder_2 (mpfi_t ROP, mpfi_t OP1, mpfi_t OP2) ;
@d mpfi_negative_p(a) (mpfi_is_strictly_neg((a))>0)
@d mpfi_positive_p(a) (mpfi_is_strictly_pos((a))>0)
@d mpfi_nonnegative_p(a) (mpfi_is_nonneg((a))>0)
@d checkZero(dec) if (mpfi_has_zero(dec) ) { // CHECK or mpfi_is_zero ?
mpfi_set_d(dec,0.0);
}
......@@ -1679,7 +1680,7 @@ relying on |real| arithmetic or system subroutines for sines, cosines, etc.
@c
void mp_interval_square_rt (MP mp, mp_number *ret, mp_number x_orig) { /* return, x: scaled */
if (!mpfi_positive_p((mpfi_ptr)x_orig.data.num)) {
if (!mpfi_nonnegative_p((mpfi_ptr)x_orig.data.num)) {
@<Handle square root of zero or negative argument@>;
} else {
mpfi_sqrt(ret->data.num, x_orig.data.num);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment