From 2fe5ce607a73ecd989066ed2fd2e238f547e6751 Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:01:05 +0300 Subject: [PATCH] fix: multiply acting as subtract --- src/main/java/me/topchetoeu/jscript/runtime/values/Value.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/topchetoeu/jscript/runtime/values/Value.java b/src/main/java/me/topchetoeu/jscript/runtime/values/Value.java index 817ef2d..e70d05d 100644 --- a/src/main/java/me/topchetoeu/jscript/runtime/values/Value.java +++ b/src/main/java/me/topchetoeu/jscript/runtime/values/Value.java @@ -547,8 +547,8 @@ public abstract class Value { var na = a.toNumber(env); var nb = b.toNumber(env); - if (na.isInt() && nb.isInt()) return NumberValue.of(na.getInt() - nb.getInt()); - else return NumberValue.of(na.getDouble() - nb.getDouble()); + if (na.isInt() && nb.isInt()) return NumberValue.of(na.getInt() * nb.getInt()); + else return NumberValue.of(na.getDouble() * nb.getDouble()); } public static final NumberValue divide(Environment env, Value a, Value b) { var na = a.toNumber(env);