Integer exponentiation bug with exponent 0

20 views
Skip to first unread message

Kenneth Brown

unread,
Oct 29, 2025, 1:59:07 AM (7 days ago) Oct 29
to Picat
Hi, I've discovered a bug with integer exponentiation.

When the base A is a bigint, A**0 is returned as a floating point value 1.0 instead of the integer 1. The issue is not present for machine sized bases A.

I've isolated the issue to arith.c in the implementation of bp_math_pow. This affects the newest version 3.9.3 as well as some older versions I've used.

I can submit a patch if desired. The changes are small and localized.
Reply all
Reply to author
Forward
0 new messages