This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-278
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-278 by this push:
new a60bf49 Update NCIdlCompilerBase.scala
a60bf49 is described below
commit a60bf4989ef35e3091fc99cc846c8e097d791bec
Author: Aaron Radzinski <[email protected]>
AuthorDate: Tue Mar 23 12:47:40 2021 -0700
Update NCIdlCompilerBase.scala
---
.../model/intent/compiler/NCIdlCompilerBase.scala | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompilerBase.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompilerBase.scala
index b5e8ef5..b2b38fc 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompilerBase.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompilerBase.scala
@@ -420,15 +420,12 @@ trait NCIdlCompilerBase {
stack.push(() ⇒ {
val (v1, v2, n) = extract()
- val v =
- if (isInt(v1) && isInt(v2)) asInt(v1) - asInt(v2)
- else if (isInt(v1) && isReal(v2)) asInt(v1) - asReal(v2)
- else if (isReal(v1) && isInt(v2)) asReal(v1) - asInt(v2)
- else if (isReal(v1) && isReal(v2)) asReal(v1) - asReal(v2)
- else
- throw rtBinaryOpError("-", v1, v2)
-
- Z(v, n)
+ if (isInt(v1) && isInt(v2)) Z(asInt(v1) - asInt(v2), n)
+ else if (isInt(v1) && isReal(v2)) Z(asInt(v1) - asReal(v2), n)
+ else if (isReal(v1) && isInt(v2)) Z(asReal(v1) - asInt(v2), n)
+ else if (isReal(v1) && isReal(v2)) Z(asReal(v1) - asReal(v2),
n)
+ else
+ throw rtBinaryOpError("-", v1, v2)
})
}
}