m-labs / artiq

A leading-edge control system for quantum information experiments
https://m-labs.hk/artiq
GNU Lesser General Public License v3.0
413 stars 192 forks source link

Fix `Int` Boundary Checks #2432

Closed fsagbuya closed 4 weeks ago

fsagbuya commented 4 weeks ago

ARTIQ Pull Request

Description of Changes

From #2320

Fix boundary check for int32 and int64.

Use <= operator to make it clear that the bounds are inclusive.

Current implementation leads to these issues (see IntBoundaryTest here):

int32:

error: cannot unify numpy.int64 with numpy.int32: 64 is incompatible with 32

int64:

error: integer literal out of range for a signed 64-bit value
-9223372036854775808
^^^^^^^^^^^^^^^^^^^^

Type of Changes

Type
:bug: Bug fix

Steps (Choose relevant, delete irrelevant before submitting)

All Pull Requests

Code Changes

Git Logistics

Licensing

See copyright & licensing for more info. ARTIQ files that do not contain a license header are copyrighted by M-Labs Limited and are licensed under LGPLv3+.