| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Previously the abs() was somehow returning a negative number, because we called it with an int8_t argument, but it was expecting "int" argument. The other bug was that "num" in the for loop stayed at -1 forever. We fixed that by using the condition "num > 0". We also switched to a while loop which make it more readable.
There was a problem hiding this comment.
Thanks, It's clean!
Sorry, something went wrong.
|
Team, does this actually fix #1825? On latest main, compiling using the following commands ./build0.sh
cmake -DWITH_FMT=yes -DCMAKE_CXX_FLAGS_RELEASE="-Wall -Wextra -O3 -funroll-loops -DNDEBUG" -DWITH_LLVM=yes .
cmake --build . -j16I am experiencing the following: $ python integration_tests/test_bit_length.py
7
3
7
7
$ lpython integration_tests/test_bit_length.py
AssertionError |
Sorry, something went wrong.
|
In #1835 (comment), am I using the correct/expected flags for release mode compilation? Also, $ cat integration_tests/test_bit_length.py
from math import floor, log2
from lpython import i8, i32, i16
def ff3():
x: i16
one: i16
one = i16(1)
x = -i16(one << i16(13))
print("ff3(): x.bit_length() =", x.bit_length(), ", where x is", x)
assert i32(x.bit_length()) == 14
ff3()
$ python integration_tests/test_bit_length.py
ff3(): x.bit_length() = 14 , where x is -8192
$ lpython integration_tests/test_bit_length.py
ff3(): x.bit_length() = 0 , where x is -8192
AssertionError |
Sorry, something went wrong.
|
@Shaikh-Ubaid can you open up a new issue? It looks like you are getting a failure: $ lpython integration_tests/test_bit_length.py AssertionError But it works on my laptop as well as the CI. Let's try to reproduce the problem that you are seeing and then we'll fix it. |
Sorry, something went wrong.
Sure. Opened here #1836. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Previously the abs() was somehow returning a negative number, because we called it with an int8_t argument, but it was expecting "int" argument.
The other bug was that "num" in the for loop stayed at -1 forever. We fixed that by using the condition "num > 0". We also switched to a while loop which make it more readable.
Fixes #1825.