diff --git a/py/objint.c b/py/objint.c
index 46290a36fceeda9d4bf82e6c36b0d1d041fc3e92..9f948a14554cd938591b6018cbd09163f9024f10 100644
--- a/py/objint.c
+++ b/py/objint.c
@@ -311,9 +311,9 @@ mp_obj_t mp_obj_new_int_from_ull(unsigned long long val) {
 }
 
 mp_obj_t mp_obj_new_int_from_uint(mp_uint_t value) {
-    // SMALL_INT accepts only signed numbers, of one bit less size
-    // then word size, which totals 2 bits less for unsigned numbers.
-    if ((value & (WORD_MSBIT_HIGH | (WORD_MSBIT_HIGH >> 1))) == 0) {
+    // SMALL_INT accepts only signed numbers, so make sure the input
+    // value fits completely in the small-int positive range.
+    if ((value & ~MP_SMALL_INT_POSITIVE_MASK) == 0) {
         return MP_OBJ_NEW_SMALL_INT(value);
     }
     nlr_raise(mp_obj_new_exception_msg(&mp_type_OverflowError, "small int overflow"));
diff --git a/py/objint_longlong.c b/py/objint_longlong.c
index 28d415e69eb830e9ca829ba886b8e3ee5f7a65a4..f10e46447b2d4a6bb2b563f97793fb6901eb9f58 100644
--- a/py/objint_longlong.c
+++ b/py/objint_longlong.c
@@ -223,9 +223,9 @@ mp_obj_t mp_obj_new_int(mp_int_t value) {
 }
 
 mp_obj_t mp_obj_new_int_from_uint(mp_uint_t value) {
-    // SMALL_INT accepts only signed numbers, of one bit less size
-    // than word size, which totals 2 bits less for unsigned numbers.
-    if ((value & (WORD_MSBIT_HIGH | (WORD_MSBIT_HIGH >> 1))) == 0) {
+    // SMALL_INT accepts only signed numbers, so make sure the input
+    // value fits completely in the small-int positive range.
+    if ((value & ~MP_SMALL_INT_POSITIVE_MASK) == 0) {
         return MP_OBJ_NEW_SMALL_INT(value);
     }
     return mp_obj_new_int_from_ll(value);
diff --git a/py/objint_mpz.c b/py/objint_mpz.c
index 24999487767fee77324eb302bf3cf5b28191c8e6..dc083827cc8542e12c85f90491597de8dc1bbf61 100644
--- a/py/objint_mpz.c
+++ b/py/objint_mpz.c
@@ -357,9 +357,9 @@ mp_obj_t mp_obj_new_int_from_ull(unsigned long long val) {
 }
 
 mp_obj_t mp_obj_new_int_from_uint(mp_uint_t value) {
-    // SMALL_INT accepts only signed numbers, of one bit less size
-    // than word size, which totals 2 bits less for unsigned numbers.
-    if ((value & (WORD_MSBIT_HIGH | (WORD_MSBIT_HIGH >> 1))) == 0) {
+    // SMALL_INT accepts only signed numbers, so make sure the input
+    // value fits completely in the small-int positive range.
+    if ((value & ~MP_SMALL_INT_POSITIVE_MASK) == 0) {
         return MP_OBJ_NEW_SMALL_INT(value);
     }
     return mp_obj_new_int_from_ull(value);