From 55169360406d8bb9ae70700701ff148afaa29846 Mon Sep 17 00:00:00 2001 From: devam007 Date: Fri, 23 Oct 2026 20:57:24 +0530 Subject: [PATCH] fix: preserve integer precision in radix sort --- sorts/radix_sort.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorts/radix_sort.py b/sorts/radix_sort.py index 47c5dd8720e3..bf46c37b44cf 100644 --- a/sorts/radix_sort.py +++ b/sorts/radix_sort.py @@ -39,7 +39,7 @@ def radix_sort(list_of_ints: list[int]) -> list[int]: buckets: list[list] = [[] for _ in range(RADIX)] # split list_of_ints between the buckets for i in list_of_ints: - tmp = int((i / placement) % RADIX) + tmp = (i // placement) % RADIX buckets[tmp].append(i) # put each buckets' contents into list_of_ints a = 0