From 3d92926a902017e7cf1f5738e99ff62da596ce12 Mon Sep 17 00:00:00 2001 From: Ethan Werner Date: Sun, 9 Aug 2026 15:02:21 +0400 Subject: refactor --- lib/logarithm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/logarithm.c') diff --git a/lib/logarithm.c b/lib/logarithm.c index 7451976..9ca98a6 100755 --- a/lib/logarithm.c +++ b/lib/logarithm.c @@ -36,8 +36,8 @@ int ts_logarithm( { TS_PROLOGUE( ts_logarithm_p ); if ( !c ) return -1; - fp_t b = ((ts_logarithm_params_t *)c)->b; - if (b == 0 || b == 1.0) return -1; + fp_t b = ((ts_logarithm_params_t const *)c)->b; + if (b <= 0 || b == 1.0 || isnan(b) || isinf(b)) return -1; b = _ts_reciprocal( log( b ) ); -- cgit v1.3.1