Package: zedmath
🎯 zedmath | MathSimple library for mathematical expressionsVERSION:1.0.0INSTALLATIONUSING PIPpipinstallzedmathCLONE REPOgitclonehttps://github.com/azizbekQozoqov/
MATH.gitUSAGEMethod namesDescriptionArgumentspowReturns the power of a numberx- Required - float or integerabsReturns the absolute value of the argumenta- Required - float or integerroundRound a number to a given precision in decimal digits.a- Required - float or integersumReturns sum of the given numbers.args- Required - integer, float, string, list[integer, float, string]is_oddReturns given numbers is odd or non odda- Required - integeris_evenReturns given numbers is even or non evena- Required - integerceilRounds a number up to its nearest integera- Required - integer, floatfloorReturns the value of a rounded down to its nearest integera- Required - integer, floatsignReturns given number is positive or negative using 1,-1,0a- Required - integer, floatminReturns minimum numbera- Required - integer, float, string, list[integer, float, string]maxReturns maximum numbera- Required - integer, float, string, list[integer, float, string]babyloniannoneS- Required - integer, floatdigitsReturns all digits of given numbern- Required - integer, floatEXAMPLESzedmath.pow(x)- Returns the power of a numbercode :# Import zedmath libraryimportzedmathaszm# Create variable called "result" and assign it the result of zd.pow methodresult=zm.pow(4,4)# Print the result variableprint(result)output :256zedmath.abs(a)- Returns the absolute value of the argumentcode :# Import zedmath libraryimportzedmathaszm# Create variable called "result" and assign it the result of zd.abs methodresult=zm.abs(-16)# Print the result variableprint(result)output :16zedmath.round(a)- Rounds a number to a given precision in decimal digits.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result", "result2"  and assign its the result of zd.round methodresult=zm.round(31.2)result2=zm.round(31.6)# Print variablesprint(result)print(result2)output :3132zedmath.sum(*args)- Returns sum of the given numbers.code :# Import zedmath libraryimportzedmathaszm# Create variable called "result" and assign it the result of zd.sum methodnumbers=[1,3,25,32.5,[21.6,"66.6",["4","6"]]]result=zm.sum(numbers)# Print the result variablesprint(result)output :159.7zedmath.is_odd(a)- Returns given numbers is odd or non odd.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result", "result2"  and assign its the result of zd.is_odd methodresult=zm.is_odd(17)result2=zm.is_odd(16)# Print the result variablesprint(result)print(result2)output :True
Falsezedmath.is_even(a)- Returns given numbers is even or non even.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result", "result2"  and assign its the result of zd.is_even methodresult=zm.is_even(17)result2=zm.is_even(16)# Print the result variablesprint(result)print(result2)output :False
Truezedmath.ceil(a)- Rounds a number up to its nearest integer.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result", "result2"  and assign its the result of zd.ceil methodresult=zm.ceil(11.7)result2=zm.ceil(11.3)# Print the result variablesprint(result)print(result2)output :1111zedmath.floor(a)- Returns the value of a rounded down to its nearest integer.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result", "result2"  and assign its the result of zd.floor methodresult=zm.floor(11.7)result2=zm.floor(11.3)# Print the result variablesprint(result)print(result2)output :1111zedmath.sign(a)- Returns given number is positive or negative using 1,-1,0.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result", "result2", "result3" and assign its the result of zd.sign methodresult=zm.sign(17)result2=zm.sign(-17)result3=zm.sign(0)# Print the result variablesprint(result)print(result2)print(result3)output :1-10zedmath.ceil(a)- Rounds a number up to its nearest integer.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result", "result2"  and assign its the result of zd.ceil methodresult=zm.ceil(11.7)result2=zm.ceil(11.3)# Print the result variablesprint(result)print(result2)output :1111zedmath.floor(a)- Returns the value of a rounded down to its nearest integer.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result", "result2"  and assign its the result of zd.floor methodresult=zm.floor(11.7)result2=zm.floor(11.3)# Print the result variablesprint(result)print(result2)output :1111zedmath.min(*args)- Returns minimum number.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result" and assign its the result of zd.min methodnumbers=[1,3,25,32.5,[21.6,"66.6",["4","6"]]]result=zm.min(numbers)# Print the result variableprint(result)output :1.0zedmath.max(*args)- Returns maximum number.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result" and assign its the result of zd.max methodnumbers=[1,3,25,32.5,[21.6,"66.6",["4","6"]]]result=zm.max(numbers)# Print the result variableprint(result)output :66.66zedmath.digits(n)- Returns all digits of given number.code :# Import zedmath libraryimportzedmathaszm# Create variables called "result" and assign its the result of zd.digits methodnumbers=178result=zm.digits(numbers)# Print the result variableprint(result)output :(1,7,8)