Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开启高精度时,long函数异常 #87

Closed
hug3id opened this issue Nov 19, 2018 · 2 comments
Closed

开启高精度时,long函数异常 #87

hug3id opened this issue Nov 19, 2018 · 2 comments
Labels

Comments

@hug3id
Copy link

hug3id commented Nov 19, 2018

版本:4.0.0RC
代码:
AviatorEvaluator.setOption(Options.ALWAYS_PARSE_FLOATING_POINT_NUMBER_INTO_DECIMAL, true);
System.out.println(AviatorEvaluator.execute("long(1.2)"));

抛出异常:
Exception in thread "main" com.googlecode.aviator.exception.ExpressionRuntimeException: Execute expression error
at com.googlecode.aviator.ClassExpression.execute(ClassExpression.java:79)
at com.googlecode.aviator.AviatorEvaluatorInstance.execute(AviatorEvaluatorInstance.java:686)
at com.googlecode.aviator.AviatorEvaluator.execute(AviatorEvaluator.java:428)
at com.googlecode.aviator.AviatorEvaluator.execute(AviatorEvaluator.java:440)
at com.googlecode.aviator.AviatorEvaluator.execute(AviatorEvaluator.java:461)
at Test.main(Test.java:7)
Caused by: java.lang.ClassCastException: Could not cast com.googlecode.aviator.runtime.type.AviatorDecimal@6f75e721 to long
at com.googlecode.aviator.runtime.function.system.LongFunction.call(LongFunction.java:41)
at Script_1542591851733_0/305623748.execute0(Unknown Source)
at com.googlecode.aviator.ClassExpression.execute(ClassExpression.java:71)
... 5 more

@killme2008 killme2008 added the bug label Nov 19, 2018
@killme2008
Copy link
Owner

收到,是个 bug,争取这周发个小版本。

@killme2008
Copy link
Owner

已在 4.1.0 中修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants