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

lang: floor and ceil functions produce incorrect result for positive and negative infinity #21463

Closed
apparentlymart opened this issue May 26, 2019 · 1 comment · Fixed by #24621
Labels
breaking-change bug config v0.12 Issues (primarily bugs) reported against v0.12 releases

Comments

@apparentlymart
Copy link
Contributor

Terraform Version

Terraform v0.12.0

Expected Behavior

floor and ceil functions, when given an infinity, should return that same infinity.

Actual Behavior

The infinity is truncated to either the minimum or maximum int64:

> ceil(1/0)
-9223372036854775808

If this result is then used somewhere else, it's likely to lead to a very confusing error message at best or degenerate behavior at worst -- like trying to create 9 trillion of something. Preserving the infinity as-is, on the other hand, would cause a reasonable range error to be produced if the result is used somewhere that an int64 is required.

@ghost
Copy link

ghost commented May 14, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change bug config v0.12 Issues (primarily bugs) reported against v0.12 releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants