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

taking cosine of large integer causes panic #1

Open
jacobhenn opened this issue Jan 23, 2024 · 1 comment
Open

taking cosine of large integer causes panic #1

jacobhenn opened this issue Jan 23, 2024 · 1 comment
Assignees

Comments

@jacobhenn
Copy link
Owner

replication

2<enter>1e6^c

error message

thread 'main' panicked at 'internal error: entered unreachable code: domain checks failed to detect non-finite result (NaN) in unary operation on Cos(Var("x"), Radian)', src/expr/cast.rs:81:17
@jacobhenn jacobhenn self-assigned this Jan 23, 2024
@jacobhenn
Copy link
Owner Author

I think the culprit is that cos(inf)=NaN, and 2^10^6 is approximately inf.

This issue raises the question: why is the finiteness check on line 79 even there? Approximating 2^10^6 displays inf, and honestly what else should it display if we want to stick with floats? I think that the solution to this issue is simply to remove that panic and let NaNs be NaNs.

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