mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
Merge branch 'master' into master
This commit is contained in:
@@ -94,4 +94,5 @@ from .degree_to_rad import *
|
||||
from .radian_to_deg import *
|
||||
from .differentiation import *
|
||||
from .definite_integral import *
|
||||
from .is_prime import *
|
||||
from .curvedSurfaceAreaCylinderFunc import *
|
||||
|
||||
@@ -15,7 +15,7 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000):
|
||||
if last_value <= 3:
|
||||
solution += (roman_dict[divisor] * last_value)
|
||||
elif last_value == 4:
|
||||
solution += (roman_dict[divisor] * roman_dict[divisor * 5])
|
||||
solution += (roman_dict[divisor] + roman_dict[divisor * 5])
|
||||
elif 5 <= last_value <= 8:
|
||||
solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5)))
|
||||
elif last_value == 9:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from .__init__ import *
|
||||
import scipy
|
||||
from scipy.integrate import quad
|
||||
|
||||
|
||||
|
||||
22
mathgenerator/funcs/is_prime.py
Normal file
22
mathgenerator/funcs/is_prime.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from .__init__ import *
|
||||
|
||||
|
||||
def isprime(max_a=100):
|
||||
a = random.randint(2, max_a)
|
||||
problem = a
|
||||
if a == 2:
|
||||
solution = True
|
||||
return (problem, solution)
|
||||
if a % 2 == 0:
|
||||
solution = False
|
||||
return (problem, solution)
|
||||
for i in range(3, a // 2 + 1, 2):
|
||||
if a % i == 0:
|
||||
solution = False
|
||||
return (problem, solution)
|
||||
solution = True
|
||||
return (problem, solution)
|
||||
|
||||
|
||||
is_prime = Generator('isprime', 90, 'a any positive integer',
|
||||
'True/False', isprime)
|
||||
@@ -1,9 +1,6 @@
|
||||
import random
|
||||
import math
|
||||
import fractions
|
||||
from .funcs import *
|
||||
from .__init__ import getGenList
|
||||
import scipy
|
||||
|
||||
|
||||
genList = getGenList()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user