forked from M-Labs/artiq
1
0
Fork 0

test/embedding: fix int boundary issues

This commit is contained in:
Sébastien Bourdeauducq 2024-08-30 12:43:38 +08:00
parent 461db782ba
commit a7b0450593
1 changed files with 4 additions and 4 deletions

View File

@ -650,15 +650,15 @@ class _IntBoundary(EnvExperiment):
self.setattr_device("core") self.setattr_device("core")
self.int32_min = numpy.iinfo(int32).min self.int32_min = numpy.iinfo(int32).min
self.int32_max = numpy.iinfo(int32).max self.int32_max = numpy.iinfo(int32).max
self.int64_min = numpy.iinfo(int64).min self.int64_min = int64(numpy.iinfo(int64).min)
self.int64_max = numpy.iinfo(int64).max self.int64_max = int64(numpy.iinfo(int64).max)
@kernel @kernel
def test_int32_bounds(self, min_val: int32, max_val: int32): def test_int32_bounds(self, min_val: int32, max_val: int32) -> bool:
return min_val == self.int32_min and max_val == self.int32_max return min_val == self.int32_min and max_val == self.int32_max
@kernel @kernel
def test_int64_bounds(self, min_val: int64, max_val: int64): def test_int64_bounds(self, min_val: int64, max_val: int64) -> bool:
return min_val == self.int64_min and max_val == self.int64_max return min_val == self.int64_min and max_val == self.int64_max
@kernel @kernel