pythagix 0.1.8__tar.gz → 0.1.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) [year] [fullname]
3
+ Copyright (c) 2025 UltraQuantumScriptor
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythagix
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: A mathy Python package with utilities like LCM, triangle numbers, etc.
5
5
  Author: UltraQuantumScriptor
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pythagix"
3
- version = "0.1.8"
3
+ version = "0.1.9"
4
4
  description = "A mathy Python package with utilities like LCM, triangle numbers, etc."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.6"
@@ -1,7 +1,6 @@
1
- from math import isqrt
1
+ import math as m
2
2
  from functools import reduce
3
3
  from typing import List
4
- import math
5
4
 
6
5
  __all__ = [
7
6
  "is_prime",
@@ -30,7 +29,7 @@ def is_prime(number: int) -> bool:
30
29
  return True
31
30
  if number % 2 == 0:
32
31
  return False
33
- for i in range(3, isqrt(number) + 1, 2):
32
+ for i in range(3, m.isqrt(number) + 1, 2):
34
33
  if number % i == 0:
35
34
  return False
36
35
  return True
@@ -90,7 +89,7 @@ def gcd(values: List[int]) -> int:
90
89
  """
91
90
  if not values:
92
91
  raise ValueError("Input list must not be empty")
93
- return reduce(math.gcd, values)
92
+ return reduce(m.gcd, values)
94
93
 
95
94
 
96
95
  def is_perfect_square(number: int) -> bool:
@@ -105,7 +104,7 @@ def is_perfect_square(number: int) -> bool:
105
104
  """
106
105
  if number < 0:
107
106
  return False
108
- root = isqrt(number)
107
+ root = m.isqrt(number)
109
108
  return root * root == number
110
109
 
111
110
 
@@ -126,7 +125,7 @@ def count_factors(number: int) -> List[int]:
126
125
  raise ValueError("Number must be positive")
127
126
 
128
127
  factors = set()
129
- for i in range(1, isqrt(number) + 1):
128
+ for i in range(1, m.isqrt(number) + 1):
130
129
  if number % i == 0:
131
130
  factors.add(i)
132
131
  factors.add(number // i)
@@ -151,9 +150,32 @@ def triangle_number(index: int) -> int:
151
150
  return index * (index + 1) // 2
152
151
 
153
152
 
153
+ def lcm(values: List[int]) -> int:
154
+ """
155
+ Compute the least common multiple (LCM) of a list of integers.
156
+
157
+ Args:
158
+ values (List[int]): A list of integers.
159
+
160
+ Returns:
161
+ int: The LCM of the numbers.
162
+
163
+ Raises:
164
+ ValueError: If the list is empty.
165
+ """
166
+ if not values:
167
+ raise ValueError("Input list must not empty")
168
+
169
+ result = 0
170
+ i1, i2 = 0, 1
171
+ for v in values:
172
+ if v
173
+
174
+
175
+
154
176
  def main() -> None:
155
177
  """Tester Function."""
156
- ...
178
+ print(lcm([2, 4, 6]))
157
179
 
158
180
 
159
181
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythagix
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: A mathy Python package with utilities like LCM, triangle numbers, etc.
5
5
  Author: UltraQuantumScriptor
6
6
  License: MIT
@@ -6,7 +6,7 @@ with open("README.md", encoding="utf-8") as f:
6
6
 
7
7
  setup(
8
8
  name="pythagix",
9
- version="0.1.8",
9
+ version="0.1.9",
10
10
  author="UltraQuantumScriptor",
11
11
  description="A mathy Python package with utilities like LCM, triangle numbers, etc.",
12
12
  long_description=long_description,
File without changes
File without changes
File without changes
File without changes