From d6b9894cc62e54039c5ccce930d75232e23e8491 Mon Sep 17 00:00:00 2001
From: Daniel Bauer <daniel.j.bauer@fau.de>
Date: Tue, 21 May 2024 19:32:04 +0200
Subject: [PATCH] print integer literals >32 bit with 'l' suffix

---
 src/pystencils/types/types.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pystencils/types/types.py b/src/pystencils/types/types.py
index 8e51f9397..1e9c0f710 100644
--- a/src/pystencils/types/types.py
+++ b/src/pystencils/types/types.py
@@ -484,7 +484,8 @@ class PsIntegerType(PsScalarType, ABC):
             raise PsTypeError(f"Given value {value} is not of required type {np_dtype}")
         unsigned_suffix = "" if self.signed else "u"
         #   TODO: cast literal to correct type?
-        return str(value) + unsigned_suffix
+        long_suffix = "" if self._width <= 32 else "l"
+        return str(value) + unsigned_suffix + long_suffix
 
     def create_constant(self, value: Any) -> Any:
         np_type = self.NUMPY_TYPES[self._width]
-- 
GitLab