You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Simplify and extend logic in binop functions #4448
Feature Description
Most of the binop functions (binopvv (vector-vector), binopvs (vector-scalar), binopsv (scalar-vector)) have unnecessarily long chains of logic to determine the output type. This makes the code hard to maintain. There should be a much simpler chain of logic to determine the output type. Similarly, the logic in the functions that actually execute the operation can hopefully be simplified. Furthermore, there is no regard to size of data types (int(8) vs int(16) vs ...) and uint seems altogether left out (technically I think this is partly referred to in Issue #4170).
Example Behavior
Should be set up to match numpy as much as possible. Technically numpy has np.float16, and Chapel doesn't support 16-bit floats, so if anything would fall there, probably just default to ak.float32.
Describe Workarounds
In some cases no, but where possible users can just directly cast results to whatever type they want.
Activity
binopvv#4459binopvs#4460binopsv#4461doBigIntBinOpvvanddoBigIntBinOpvvBoolReturn#4569doBigIntBinOpvsanddoBigIntBinOpvsBoolReturn#4570doBigIntBinOpsvanddoBigIntBinOpsvBoolReturn#45711RyanK commentedon Dec 23, 2025
I was thinking about fixing up
opeqvvandopeqvsas well and this may help.1RyanK commentedon Jan 12, 2026
Here's code that tests differences. It's vv and vs/sv, but I think not opeq (in place).
I think it might be worth trying to merge bigint binops and regular binops, like it is with opeq. Probably will combine more code.
opeqfunctions #5408