Closed taxor03 closed 5 months ago
I've reviewed the code, and I have a concern regarding the handling of Infinity values in the context of the statement you've mentioned.
In the Compiler.scala
you've modified, the code proceeds with the modulo operation and determines if the value is odd. However, based on the current implementation in Compiler.scala
, it seems that the logic doesn't explicitly handle the case where _exponent_
is Infinity.
Considering that Infinity is not a finite value and the modulo operation may not be well-defined in this context, I suggest modifying the Compiler.scala
to explicitly check for Infinity and handle it accordingly. In this way, we can ensure that the code behaves as expected even when dealing with non-finite values.
LGTM! 👍🏻
This PR includes adding OddIntegralNumber to support following form of statement in spec:
So, we added some logics according to OddIntegralNumber but encountered an issue handling Infinity value. The issue is occurred in following code snippet in
EConvert
case ininterpreter.scala
:As the type of
d
value in this function isDouble
,d
allows Infinity value (POS/NEG). However when we convertDouble.NegativeInfinity
into Math value, it throws error. This is because BigDecimal doesn't support Infinity value.