Add check for interval
This commit is contained in:
parent
c2952fa8a1
commit
9b4971079b
2 changed files with 11 additions and 0 deletions
|
@ -23,6 +23,16 @@ status t1_solve (
|
|||
memcpy(&bits, &y_b, sizeof(bits));
|
||||
sgn_b = (bits >> 63) & 1;
|
||||
|
||||
if (fabs(y_a) - eps < DBL_EPSILON)
|
||||
{
|
||||
*x = a;
|
||||
return SUCCESS;
|
||||
} if (fabs(y_b) - eps < DBL_EPSILON)
|
||||
{
|
||||
*x = b;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (sgn_a == sgn_b)
|
||||
{
|
||||
*x = DBL_MAX;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue