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
Overflow in exponentiation #2646
Comments
I think this is correct. 2**31 is beyond the bounds of integer. |
But since I'm actually using (2 ** 31 - 1) perhaps it should be okay? I just wonder because if it's used inside the to_string() function it works fine. |
So 2**31 is out of the integer range, that's why you get overflow in most cases. For |
Right, I just thought since I'm actually using (2 ** 31 - 1) and not 2 ** 31 as the integer value perhaps it could work, since it works when using it inside the to_string() function, but if it's not the case then I'll just use a workaround with integer'right. |
I guess the |
Description
I get an overflow error and I wonder if it's a GHDL or the code problem.
How to reproduce?
The testbench below has 3 scenarios:
First, using the attribute to print the maximum integer positive value which works okay.
Then, using exponentiation, which works for the to_string() procedure but not for the other 2 cases, which give the following error:
Finally, using exponentiation but with a hardcoded value, which gives the following errors:
Context
The text was updated successfully, but these errors were encountered: