From 940f315b677a91afc84dbd7e38afc86a49901a0d Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Tue, 22 Feb 2022 20:25:31 +0900 Subject: [PATCH] adding missing commit (issue #815) --- include/chibi/sexp.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/chibi/sexp.h b/include/chibi/sexp.h index 5edef840..bd27527c 100644 --- a/include/chibi/sexp.h +++ b/include/chibi/sexp.h @@ -1080,6 +1080,13 @@ SEXP_API sexp sexp_make_unsigned_integer(sexp ctx, sexp_luint_t x); else \ sexp_negate_exact(x) +#define sexp_negate_maybe_ratio(x) \ + if (sexp_ratiop(x)) { \ + sexp_negate_exact(sexp_ratio_numerator(x)); \ + } else { \ + sexp_negate(x); \ + } + #if SEXP_USE_FLONUMS || SEXP_USE_BIGNUMS #if SEXP_64_BIT