iets3.opensource icon indicating copy to clipboard operation
iets3.opensource copied to clipboard

Numbers in scientific notation without number part shouldn't be allowed

Open alexanderpann opened this issue 1 year ago • 0 comments

The following expression can be entered: e-5 / 10 equals 1e-6. The number only has an exponent (e-5) which is allowed according to the constraints but doesn't work with the type system and interpreter:

java.lang.NumberFormatException: No digits found.
	at java.base/java.math.BigDecimal.<init>(BigDecimal.java:588)
	at java.base/java.math.BigDecimal.<init>(BigDecimal.java:467)
	at java.base/java.math.BigDecimal.<init>(BigDecimal.java:896)
	at org.iets3.core.expr.base.plugin.InfHelper.div(InfHelper.java:119)

We should probably disallow those numbers.

alexanderpann avatar Jul 20 '23 20:07 alexanderpann