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

012-floating-point.md : NaN != NaN はtrue? #157

Open
sukeya opened this issue Aug 4, 2021 · 0 comments
Open

012-floating-point.md : NaN != NaN はtrue? #157

sukeya opened this issue Aug 4, 2021 · 0 comments

Comments

@sukeya
Copy link

sukeya commented Aug 4, 2021

012-floating-point.mdのNaN(Not a Number)の節で、

// false
bool d = NaN != NaN ;

とあります(コードから抜粋)。しかし、このサイトの例でgcc 11.1(C++20)を選び、

std::cout << "NaN != NaN? " << std::boolalpha
<< ( std::numeric_limits::quiet_NaN()
!= std::numeric_limits::quiet_NaN() ) << '\n';

を追記し、実行するとtrueになりました。
NaN != NaN はtrueではないでしょうか?

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

1 participant