Commit 660521a4 authored by Marko Mäkelä's avatar Marko Mäkelä Committed by GitHub

Merge pull request #263 from grooverdan/10.2-MDEV-11451-isfinite

MDEV-11451: isinf || isnan -> !isfinite
parents cc85ba8f b11eb369
...@@ -2671,7 +2671,7 @@ String *Item_func_format::val_str_ascii(String *str) ...@@ -2671,7 +2671,7 @@ String *Item_func_format::val_str_ascii(String *str)
return 0; /* purecov: inspected */ return 0; /* purecov: inspected */
nr= my_double_round(nr, (longlong) dec, FALSE, FALSE); nr= my_double_round(nr, (longlong) dec, FALSE, FALSE);
str->set_real(nr, dec, &my_charset_numeric); str->set_real(nr, dec, &my_charset_numeric);
if (isnan(nr) || my_isinf(nr)) if (!isfinite(nr))
return str; return str;
str_length=str->length(); str_length=str->length();
} }
......
...@@ -364,8 +364,9 @@ mbr_join_square( ...@@ -364,8 +364,9 @@ mbr_join_square(
b += 2; b += 2;
} while (a != end); } while (a != end);
/* Check for infinity or NaN, so we don't get NaN in calculations */ /* Check if finite (not infinity or NaN),
if (my_isinf(square) || my_isnan(square)) { so we don't get NaN in calculations */
if (!isfinite(square)) {
return DBL_MAX; return DBL_MAX;
} }
......
...@@ -1988,7 +1988,7 @@ rtr_estimate_n_rows_in_range( ...@@ -1988,7 +1988,7 @@ rtr_estimate_n_rows_in_range(
mtr_commit(&mtr); mtr_commit(&mtr);
mem_heap_free(heap); mem_heap_free(heap);
if (my_isinf(area) || my_isnan(area)) { if (!isfinite(area)) {
return(HA_POS_ERROR); return(HA_POS_ERROR);
} }
......
...@@ -69,8 +69,8 @@ static double mbr_join_square(const double *a, const double *b, int n_dim) ...@@ -69,8 +69,8 @@ static double mbr_join_square(const double *a, const double *b, int n_dim)
b += 2; b += 2;
}while (a != end); }while (a != end);
/* Check for infinity or NaN */ /* Check if not finite (i.e. infinity or NaN) */
if (my_isinf(square) || isnan(square)) if (!isfinite(square))
square = DBL_MAX; square = DBL_MAX;
return square; return square;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment