fix: preserve numerical precision on unary negation (#3242)
This commit is contained in:
1 parent
972772153f
commit
6ce3bdf382
7 files changed
+55
-22
No files matched your search
+1
-1
@@ -256,7 +256,7 @@ static jv f_negate(jq_state *jq, jv input) {
|
||||
if (jv_get_kind(input) != JV_KIND_NUMBER) {
|
||||
return type_error(input, "cannot be negated");
|
||||
}
|
||||
jv ret = jv_number(-jv_number_value(input));
|
||||
jv ret = jv_number_negate(input);
|
||||
jv_free(input);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user