-
Notifications
You must be signed in to change notification settings - Fork 53
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
generic validation false positive #681
Comments
This error is caused due to behaviour of the builtin EXPT function. Here, we differentiate between signed and unsigned integer types and, if smaller than 32 bit, annotate their types as DINT or UDINT respectively. I have discussed this with @99NIMI and we tried to always use DINT, regardless of sign. For an exponentiation
Granted, the result of such a large exponent will overflow for almost any K larger than 1.. Here is a Rust Playground example of A different approach would be to once again emulate C and have the result of EXPT always be LREAL and typecast the result Please discuss. |
@ghaith pointed out that we can't simply drop the sign check because negative exponents result in floating point results, which, in hindsight, is obvious. |
linked: StandardFunctions issue |
Describe the bug
When calling the builtin EXPT function with int types, without explicitly annotating the exponent, a validation error is reported.
This looks like a false-positive.
To Reproduce
Steps to reproduce the behavior:
Tests
Failing test can be found in linked dev branch.
The text was updated successfully, but these errors were encountered: