From 8a2e88390bee4f602e81fe310f90e503c34f1f8f Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 9 Jan 2024 07:47:57 +0900 Subject: [PATCH] mruby-math: reduce the scope of a local variable --- mrbgems/mruby-math/src/math.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mrbgems/mruby-math/src/math.c b/mrbgems/mruby-math/src/math.c index fdb533dcf..26a6eaa40 100644 --- a/mrbgems/mruby-math/src/math.c +++ b/mrbgems/mruby-math/src/math.c @@ -137,7 +137,7 @@ erfc(double x) double q1; double q2 = b/d; double n = 1.0; - double t; + if (fabs(x) < 2.2) { return 1.0 - erf(x); } @@ -145,7 +145,7 @@ erfc(double x) return 2.0 - erfc(-x); } do { - t = a*n+b*x; + double t = a*n+b*x; a = b; b = t; t = c*n+d*x;