Skip to content

Commit 5516936

Browse files
committed
fix: preserve integer precision in radix sort
1 parent 6e03a48 commit 5516936

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sorts/radix_sort.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def radix_sort(list_of_ints: list[int]) -> list[int]:
3939
buckets: list[list] = [[] for _ in range(RADIX)]
4040
# split list_of_ints between the buckets
4141
for i in list_of_ints:
42-
tmp = int((i / placement) % RADIX)
42+
tmp = (i // placement) % RADIX
4343
buckets[tmp].append(i)
4444
# put each buckets' contents into list_of_ints
4545
a = 0

0 commit comments

Comments
 (0)