Skip to content

Commit 167cb35

Browse files
committed
added new function
1 parent da58759 commit 167cb35

File tree

7 files changed

+17
-2
lines changed

7 files changed

+17
-2
lines changed

.DS_Store

0 Bytes
Binary file not shown.

DOCUMENTATION.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Tai menemällä latauksiin > ja lataamalla rkmath-0.1.0.tar.gz tai uusin versio.
5454
| `suurinYhteinenTekijä` | returns the biggest common divider |
5555
| `varianssi` | returns the variance of an array |
5656
| `toisen_asteen_lause` | returns the solved form of quadratic equation |
57+
| `alkuluku` | returns prime numbers of a number |
5758

5859
### Finnish descriptions
5960

@@ -73,6 +74,7 @@ Tai menemällä latauksiin > ja lataamalla rkmath-0.1.0.tar.gz tai uusin versio.
7374
| `suurinYhteinenTekijä` | palauttaa suurimman yhteisen tekijän |
7475
| `varianssi` | palauttaa lukujonon varianssin |
7576
| `toisen_asteen_lause` | palauttaa toisen asteen yhtälön ratkaisut. |
77+
| `alkuluku` | n:n alkuluvut |
7678

7779

7880

dist/rkmath-0.2.8-py3-none-any.whl

3.64 KB
Binary file not shown.

dist/rkmath-0.2.8.tar.gz

3.44 KB
Binary file not shown.

rkmath.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.4
22
Name: rkmath
3-
Version: 0.2.7
3+
Version: 0.2.8
44
Summary: Math library for easy math operations
55
Author: Swifterhtmler
66
Description-Content-Type: text/markdown

rkmath/myfunctions.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,17 @@ def RKMathIsTheBestLibraryIHaveEverUsed():
7070
return "RKMATH is the best library I have ever used!!!"
7171

7272

73+
def alkuluku(n):
74+
if n < 2:
75+
return []
76+
77+
sieve = [True] * (n + 1)
78+
sieve[0:2] = [False, False]
79+
80+
for i in range(2, int(n**0.5) + 1):
81+
if sieve[i]:
82+
sieve[i*i:n+1:i] = [False] * len(range(i*i, n+1, i))
83+
84+
return [i for i, is_prime in enumerate(sieve) if is_prime]
85+
7386

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
setup(
77
name='rkmath',
88
packages=find_packages(include=['rkmath']),
9-
version='0.2.7',
9+
version='0.2.8',
1010
description='Math library for easy math operations',
1111
long_description=long_description,
1212
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)