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

NaN计算异常问题 #563

Open
ques666 opened this issue Aug 2, 2023 · 1 comment
Open

NaN计算异常问题 #563

ques666 opened this issue Aug 2, 2023 · 1 comment

Comments

@ques666
Copy link

ques666 commented Aug 2, 2023

math.sqrt(-1) > 5 计算这个表达式得到结果为true,这和其他语言以及传统理解不符吧,是BUG吗?还是说有特殊配置?

@killme2008
Copy link
Owner

遵循的是 Double.compare 和 Float.compare 的规则,确实跟其他语言不一样

https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html#compareTo-java.lang.Double-

我想想怎么修复。

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

No branches or pull requests

2 participants