Package: simple_math
Thank you for installing simple_math.You can contact me for problems, bugs, and suggetions of simple_math atnoahmouse2011@gmail.comWhat's new in simple_math 1.1.0almost ALL functions had a performance boostremoved useless changing whole number to int's in certain functionsexno has added optional argument "powers"now works correctly with floating-point-numbersmode only uses one argumentpvint and pvfloat have both been replaced by plvalold definitions are now wrappers but will be removedin future updatefactors now includes n for factors(n)prifac can now compute for numbers with numberof prime factors > 1000median works for unsorted listsprobably many more bug fixes that are unknown tome at the timeInfo about newest functionsexno(num:int, powers:bool = False) --> strReturn the Expanded Notation of "num" as a string>>> simple_math.exno(325)'( 3 * 100 ) + ( 2 * 10 ) + ( 5 * 1 )'>>> simple_math.exno(30201)'( 3 * 10000 ) + ( 2 * 100 ) + ( 1 * 1 )'>>> simple_math.exno(30201.023)'( 3 * 10000 ) + ( 2 * 100 ) + ( 1 * 1 ) + ( 2 * 0.01 ) + ( 3 * 0.001 )'>>> simple_math.exno(30201.023,powers=True)'( 3 * 10**4 ) + ( 2 * 10**2 ) + ( 1 * 10**0 ) + ( 2 * 10**-2 ) + ( 3 * 10**-3 )'>>> simple_math.exno(1,powers=True)'( 1 * 10**0 )'>>>factors(num:int) --> listReturn all factors of an int as a listRaises ValueError for negitive orfloating point numbers>>> simple_math.factors(10)[1, 2, 5, 10]>>> simple_math.factors(100)[1, 2, 4, 5, 10, 20, 25, 50, 100]>>> simple_math.factors(83) # prime number[1, 83]>>>gcf(num1:int,num2:int) --> intReturn the Greatest Common Factor of two numbersAlready implemented in module "fractions" (and "math" in python 3.5)may remove in future>>> simple_math.gcf(4,6)2>>> simple_math.gcf(1,1000)1>>> simple_math.gcf(20,10)10>>>gcfl(l:list) --> intReturn the Greatest Common Factor of a list of numbers>>> simple_math.gcfl([4,6,8,10])2>>> simple_math.gcfl([15,12,9,6])3>>> simple_math.gcfl([number for number in range(100)]) #l=[0,1,2,3,4,5 ... 99]1>>>lcd(num1:int,num2:int) --> intReturn the Least Common Denominator of two numbers>>> simple_math.lcd(2,3)6>>> simple_math.lcd(14,7)14>>> simple_math.lcd(1000,1001)1001000>>>lcdl(l:list) --> intReturn the Least Common Denominator of a list of numbers>>> simple_math.lcdl([1,2,3])6>>> simple_math.lcdl([12,6,18])36>>> simple_math.lcdl([0,1,2,3,4,5])Traceback (most recent call last):File "<stdin>", line 1, in <module>File "simple_math.py", line 128, in lcdlraise ValueError('invalid number "0"')ValueError: invalid number "0">>>mean(l:list) --> floatReturn the Mean (Average) of a list of numbers>>> simple_math.mean([1,2,3])2.0>>> simple_math.mean([3])3.0>>> simple_math.mean([9,4,10])7.666666666666667>>> simple_math.mean([1,2,3,4])2.5>>>median(l:list) --> floatReturn the Median of a list of numbers>>> simple_math.median([1,2,3])2.0>>> simple_math.median([6,2,0,4,8])4.0>>> simple_math.median([6,2,0,4,8,5])4.5>>> simple_math.median([6,2,0,4,8,8])5.0>>>mode(l:list) --> listReturn the Mode(s) in a list>>> simple_math.mode([])[]>>> simple_math.mode([3])[3]>>> simple_math.mode([1,2,3,4,5,6])[1, 2, 3, 4, 5, 6]>>> simple_math.mode([1,2,3,4,5,6,6])[6]>>> simple_math.mode([1,2,3,4,5,6,6,1])[1, 6]>>>pvint(num:int, place_value:int = 1) --> intThis is an old function and is replacable by plvalWill be removed in future versionspvfloat(num:float, place_value:float = 1.0)This is an old function and is replacable by plvalWill be removed in future versionsplval(num:float, place_value:int = 0)Return the Place Value of a numberPlace_value refers to n where the specified digit is in the 10^n slotRaises ValueError if place value provided is invalid>>> simple_math.plval(123)3>>> simple_math.plval(1024,3)1>>> simple_math.plval(1024.1024,-3)2>>>prifac(num:int) --> listReturn the Prime Factorization of num in a list>>> simple_math.prifac(8)[2, 2, 2]>>> simple_math.prifac(6)[2, 3]>>> simple_math.prifac(2*3*5*7)[2, 3, 5, 7]>>> simple_math.prifac(0) # 0 < 2[]>>>prime(num:int) --> boolReturn True if num is a prime number and False if not>>> simple_math.prime(3)True>>> simple_math.prime(4)False>>> simple_math.prime(13)True>>> simple_math.prime(1)False>>> simple_math.prime(-1)False>>>primes_to(num:float) --> listReturn a list of all the primes up to a number>>> simple_math.primes_to(10)[2, 3, 5, 7]>>> simple_math.primes_to(0)[]>>> simple_math.primes_to(17)[2, 3, 5, 7, 11, 13, 17]>>>psr(num:int):Return true if num has a Perfect Square Root and false otherwise>>> simple_math.psr(4)True>>> simple_math.psr(5)False>>> simple_math.psr(0)True>>> simple_math.psr(123**2)True>>>refine(string:str, variables:list = []) --> strReturn a parsed math term mostly readable by pythoneg.  .25 -> 0.25 ,  2x(54/3) -> 2*x*(54/3) ,| 1-x^3 \|/{10-4} -> (abs (1-x**3) )/(10-4)  etc.second parameter is a list of single characterreserved as unknown valuesNot fully reliableWill be changed in future versions>>> simple_math.refine('.25')'0.25'>>> simple_math.refine('2x(54/3)',['x'])'2*x*(54/3)'>>> simple_math.refine('| 1-x^3 \| /{10-[4]}',['x'])'(abs (1-x**3) )/(10-(4))'>>> simple_math.refine('y=x^2',['x','y']) # bug!'y*=*x**2'>>>