File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ unit_evaluate(const char *str, const char **endptr)
8080{
8181 double ret = unit_evaluate_dbl (str, false , endptr);
8282
83- if (ret == NAN || ret >= nexttoward ((double ) LLONG_MAX, LLONG_MAX)) {
83+ if (std::isnan (ret) ||
84+ ret >= nexttoward ((double ) LLONG_MAX, LLONG_MAX)) {
8485 return LLONG_MIN;
8586 }
8687
@@ -94,7 +95,7 @@ unit_evaluate(const char *str, const char **endptr)
9495 * @param case_sensitive should 'm' be considered as mega
9596 * @param endptr if not NULL, point to suffix after parse
9697 * @returns positive floating point representation of the string
97- * @returns NAN if error
98+ * @returns NAN if error (isnan() must be called to check ret val)
9899 */
99100double
100101unit_evaluate_dbl (const char *str, bool case_sensitive, const char **endptr)
You can’t perform that action at this time.
0 commit comments