ഗണിതം#
ആമുഖം#
മാത്തിൽ ബിൽറ്റ്-ഇൻ പൈത്തൺ ഫംഗ്ഷനുകളും പൂർണ്ണമായ math മൊഡ്യൂളും ഉൾപ്പെടുന്നു, ഇത് VEXcode AIM-ൽ യാന്ത്രികമായി ലഭ്യമാണ്. അടിസ്ഥാന ഗണിതം മുതൽ വിപുലമായ ത്രികോണമിതി, റൗണ്ടിംഗ്, ലോഗരിഥമിക് പ്രവർത്തനങ്ങൾ വരെ എല്ലാം ചെയ്യാൻ ഈ ഉപകരണങ്ങൾ നിങ്ങളെ അനുവദിക്കുന്നു.
നിങ്ങളുടെ റോബോട്ടിന്റെ സ്ഥാനങ്ങൾ, കോണുകൾ, ദൂരങ്ങൾ, മറ്റ് സംഖ്യാ മൂല്യങ്ങൾ എന്നിവ കണക്കാക്കാൻ ഈ ഫംഗ്ഷനുകളും സ്ഥിരാങ്കങ്ങളും ഉപയോഗിക്കുക. നിങ്ങൾക്ക് ഡിഗ്രികൾക്കും റേഡിയനുമിടയിൽ പരിവർത്തനം ചെയ്യാനും എക്സ്പ്രഷനുകൾ വിലയിരുത്താനും ഇൻഫിനിറ്റി, NaN പോലുള്ള പ്രത്യേക മൂല്യങ്ങളുമായി പ്രവർത്തിക്കാനും കഴിയും.
ലഭ്യമായ ഗണിത ഫംഗ്ഷനുകൾ, സ്ഥിരാങ്കങ്ങൾ, യൂട്ടിലിറ്റികൾ എന്നിവയുടെ ഒരു ലിസ്റ്റ് താഴെ കൊടുക്കുന്നു:
ബിൽറ്റ്-ഇൻ ഫംഗ്ഷനുകൾ - പൈത്തണിൽ ഉൾപ്പെടുത്തിയിരിക്കുന്ന സാധാരണ ഗണിത ഉപകരണങ്ങൾ.
abs– ഒരു സംഖ്യയുടെ കേവല മൂല്യം നൽകുന്നു.round– ഒരു സംഖ്യയെ നിശ്ചിത ദശാംശ സ്ഥാനങ്ങളിലേക്ക് റൗണ്ട് ചെയ്യുന്നു.min– ഇൻപുട്ട് മൂല്യങ്ങളിൽ ഏറ്റവും ചെറിയത് നൽകുന്നു.max– ഇൻപുട്ട് മൂല്യങ്ങളിൽ ഏറ്റവും വലുത് നൽകുന്നു.sum– ഒരു ഇറ്ററബിളിലെ എല്ലാ മൂല്യങ്ങളും ചേർക്കുന്നു.divmod– ഘടകാംശവും ശിഷ്ടവും ഒരു ട്യൂപ്പിളായി നൽകുന്നു.pow– ഒരു സംഖ്യയെ ഒരു പവറിലേക്ക് ഉയർത്തുന്നു, ഓപ്ഷണലായി ഒരു മോഡുലസ് ഉപയോഗിച്ച്.int– ഒരു മൂല്യത്തെ ഒരു പൂർണ്ണസംഖ്യയിലേക്ക് പരിവർത്തനം ചെയ്യുന്നു.float– ഒരു മൂല്യത്തെ ഒരു ഫ്ലോട്ടിംഗ്-പോയിന്റ് സംഖ്യയിലേക്ക് പരിവർത്തനം ചെയ്യുന്നു.
സ്ഥിരാങ്കങ്ങൾ - math മൊഡ്യൂളിൽ നിന്നുള്ള മുൻനിശ്ചയിച്ച മൂല്യങ്ങൾ.
math.pi– സ്ഥിരാങ്കം π (പൈ).math.tau– സ്ഥിരാങ്കം ടൗ (2π).math.e– സ്വാഭാവിക ലോഗിന്റെ ബേസ്, യൂളർ സംഖ്യ.math.inf– പോസിറ്റീവ് ഇൻഫിനിറ്റി.math.nan- ഒരു സംഖ്യയല്ല (NaN).
ത്രികോണമിതി - വശങ്ങൾ തമ്മിലുള്ള കോണുകളും ബന്ധങ്ങളും കണക്കാക്കുക.
math.sin– റേഡിയനുകളിൽ ഒരു കോണിന്റെ സൈൻ.math.cos– റേഡിയനുകളിൽ ഒരു കോണിന്റെ കോസൈൻ.math.tan– റേഡിയനുകളിൽ ഒരു കോണിന്റെ ടാൻജെന്റ്.math.atan– റേഡിയനുകളിൽ ഒരു മൂല്യത്തിന്റെ ആർക്റ്റാൻജന്റ്.math.atan2– ക്വാഡ്രന്റ് കണക്കിലെടുക്കുമ്പോൾ, റേഡിയനുകളിൽ y/x ന്റെ ആർക്റ്റാൻജന്റ്.math.asin– റേഡിയനുകളിൽ ഒരു മൂല്യത്തിന്റെ ആർക്ക്സൈൻ.math.acos– റേഡിയനുകളിൽ ഒരു മൂല്യത്തിന്റെ ആർക്കോസിൻ.math.degrees– റേഡിയനുകളെ ഡിഗ്രികളാക്കി മാറ്റുന്നു.math.radians– ഡിഗ്രികളെ റേഡിയനുകളാക്കി മാറ്റുന്നു.
ഹൈപ്പർബോളിക്സ് - വിപുലമായ ട്രിഗ്-അനുബന്ധ പ്രവർത്തനങ്ങൾ.
math.sinh– ഒരു മൂല്യത്തിന്റെ ഹൈപ്പർബോളിക് സൈൻ.math.cosh– ഒരു മൂല്യത്തിന്റെ ഹൈപ്പർബോളിക് കോസൈൻ.math.tanh– ഒരു മൂല്യത്തിന്റെ ഹൈപ്പർബോളിക് ടാൻജെന്റ്.math.asinh– വിപരീത ഹൈപ്പർബോളിക് സൈൻ.math.acosh– വിപരീത ഹൈപ്പർബോളിക് കോസൈൻ.math.atanh– വിപരീത ഹൈപ്പർബോളിക് ടാൻജെന്റ്.
റൗണ്ടിംഗ് & കേവല മൂല്യം – കൃത്യതയോ ദിശയോ ക്രമീകരിക്കുക.
math.ceil– ഏറ്റവും അടുത്തുള്ള പൂർണ്ണസംഖ്യയിലേക്ക് റൗണ്ട് ചെയ്യുന്നു.math.floor– ഏറ്റവും അടുത്തുള്ള പൂർണ്ണസംഖ്യയിലേക്ക് റൗണ്ട് ചെയ്യുന്നു.math.trunc– ദശാംശ ഭാഗം നീക്കം ചെയ്യുന്നു.math.fabs– ഒരു ഫ്ലോട്ടായി കേവല മൂല്യം നൽകുന്നു.
എക്സ്പോണന്റുകളും ലോഗരിതങ്ങളും - പവർ, റൂട്ട്, ലോഗ് കണക്കുകൂട്ടലുകൾ.
math.pow– ഒരു സംഖ്യയെ ഒരു ശക്തിയിലേക്ക് ഉയർത്തുന്നു.math.sqrt– വർഗ്ഗമൂലത്തെ തിരികെ നൽകുന്നു.math.exp– x ന്റെ ശക്തിയിലേക്ക് e കണക്കാക്കുന്നു.math.log– സ്വാഭാവിക ലോഗരിതം (ബേസ് e).math.log10– ബേസ്-10 ലോഗരിതം.math.log2– ബേസ്-2 ലോഗരിതം.math.factorial– ഒരു പൂർണ്ണസംഖ്യയുടെ ഫാക്റ്റോറിയൽ.math.expm1–e^x - 1ന് കൂടുതൽ കൃത്യമായ ഫലം.
ഫ്ലോട്ടിംഗ് പോയിന്റ് പ്രവർത്തനങ്ങൾ - ഫ്ലോട്ട് മൂല്യങ്ങൾ പരിശോധിക്കുക അല്ലെങ്കിൽ വിഘടിപ്പിക്കുക.
math.modf– ഒരു ഫ്ലോട്ടിന്റെ ഫ്രാക്ഷണൽ, ഇൻറിജർ ഭാഗങ്ങൾ തിരികെ നൽകുന്നു.math.frexp– ഒരു സംഖ്യയെ മാന്റിസ്സയായും ഘാതാംഗമായും വിഘടിപ്പിക്കുന്നു.math.fmod– ഡിവിഡന്റിന്റെ ചിഹ്നമുള്ള ശിഷ്ടം.math.copysign– മറ്റൊന്നിന്റെ ചിഹ്നമുള്ള ഒരു മൂല്യം നൽകുന്നു.math.ldexp–x * (2 ** exp)കണക്കാക്കുന്നു.
താരതമ്യവും ഏകദേശവും - സഹിഷ്ണുതകളുമായോ വിഭാഗങ്ങളുമായോ മൂല്യങ്ങൾ പരിശോധിക്കുക.
math.isclose– രണ്ട് മൂല്യങ്ങൾ ഏകദേശം തുല്യമാണോ എന്ന് പരിശോധിക്കുന്നു.math.isfinite– ഒരു സംഖ്യ പരിമിതമാണോ എന്ന് പരിശോധിക്കുന്നു.math.isinf– ഒരു സംഖ്യ അനന്തമാണോ എന്ന് പരിശോധിക്കുന്നു.math.isnan– ഒരു മൂല്യം NaN ആണോ എന്ന് പരിശോധിക്കുന്നു.
പിശകും ഗാമയും – പ്രത്യേക ഗണിത പ്രവർത്തനങ്ങൾ.
math.gamma– ഗാമ ഫംഗ്ഷൻ (സാമാന്യവൽക്കരിച്ച ഫാക്റ്റോറിയൽ).math.lgamma– ലോഗരിഥമിക് ഗാമ.math.erf– പിശക് പ്രവർത്തനം.math.erfc– കോംപ്ലിമെന്ററി പിശക് ഫംഗ്ഷൻ.
ബിൽറ്റ്-ഇൻ ഫംഗ്ഷനുകൾ#
നിങ്ങളുടെ പ്രോജക്റ്റിനുള്ളിൽ ഗണിത പ്രവർത്തനങ്ങൾ നടത്താൻ നിങ്ങളെ അനുവദിക്കുന്ന നിരവധി ബിൽറ്റ്-ഇൻ ഫംഗ്ഷനുകൾ പൈത്തൺ നൽകുന്നു.
abs#
abs ഒരു സംഖ്യയുടെ കേവല മൂല്യം നൽകുന്നു, ഏതെങ്കിലും നെഗറ്റീവ് ചിഹ്നം നീക്കം ചെയ്യുന്നു.
Usage:
abs(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു പൂർണ്ണസംഖ്യ അല്ലെങ്കിൽ ഫ്ലോട്ട്. |
# Get the absolute value of -10
abs_result = abs(-10)
robot.screen.print(abs_result)
# abs_result = 10
round#
round ഒരു സംഖ്യയെ നിശ്ചിത ദശാംശ സ്ഥാനങ്ങളിലേക്ക് റൗണ്ട് ചെയ്യുന്നു.
Usage:
round(x, ndigits)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു പൂർണ്ണസംഖ്യ അല്ലെങ്കിൽ ഫ്ലോട്ട്. |
|
ഓപ്ഷണൽ. റൗണ്ട് ചെയ്യേണ്ട ദശാംശ സ്ഥാനങ്ങളുടെ എണ്ണം. ഡിഫോൾട്ട് 0 ആണ്. |
# Round 5.7 to the nearest integer
round_int_result = round(5.7)
robot.screen.print(round_int_result)
# round_int_result = 6
# Round 3.14159 to 2 decimal places
round_result = round(3.14159, 2)
robot.screen.print(round_result)
# round_result = 3.14
min#
min ഒന്നിലധികം ആർഗ്യുമെന്റുകളിൽ നിന്നോ ഒരു ഇറ്ററബിളിൽ നിന്നോ ഉള്ള ഏറ്റവും ചെറിയ മൂല്യം നൽകുന്നു.
Usage:
min(arg1, arg2, …) or min(sequence)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
താരതമ്യം ചെയ്യേണ്ട സംഖ്യകൾ. |
|
ഒരു ലിസ്റ്റ്, ട്യൂപ്പിൾ അല്ലെങ്കിൽ അക്കങ്ങൾ അടങ്ങിയ മറ്റ് ശ്രേണി. |
# Get the smallest number from 3, 7, and 1
min_result = min(3, 7, 1)
robot.screen.print(min_result)
# min_result = 1
# Get the smallest value from a list
min_list_result = min([10, 4, 25, 1])
robot.screen.print(min_list_result)
# min_list_result = 1
max#
ഒന്നിലധികം ആർഗ്യുമെന്റുകളിൽ നിന്നോ ഒരു ഇറ്ററബിളിൽ നിന്നോ ഏറ്റവും വലിയ മൂല്യം max നൽകുന്നു.
Usage:
max(arg1, arg2, …) or max(sequence)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
താരതമ്യം ചെയ്യേണ്ട സംഖ്യകൾ. |
|
ഒരു ലിസ്റ്റ്, ട്യൂപ്പിൾ അല്ലെങ്കിൽ അക്കങ്ങൾ അടങ്ങിയ മറ്റ് ശ്രേണി. |
# Get the largest number from 3, 7, and 1
max_result = max(3, 7, 1)
robot.screen.print(max_result)
# max_result = 7
# Get the largest value from a list
max_list_result = max([10, 4, 25, 1])
robot.screen.print(max_list_result)
# max_list_result = 25
sum#
sum എന്നത് ഒരു ഇറ്ററബിളിലെ എല്ലാ മൂല്യങ്ങളെയും ഒരു ഓപ്ഷണൽ ആരംഭ മൂല്യത്തോടെ കൂട്ടിച്ചേർക്കുന്നു.
Usage:
sum(sequence, start)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു ലിസ്റ്റ്, ട്യൂപ്പിൾ അല്ലെങ്കിൽ അക്കങ്ങൾ അടങ്ങിയ മറ്റ് ശ്രേണി. |
|
ഓപ്ഷണൽ. തുകയിലേക്ക് ചേർക്കേണ്ട ഒരു മൂല്യം. ഡിഫോൾട്ട് 0 ആണ്. |
# Calculate the sum of a list of numbers
sum_result = sum([1, 2, 3, 4, 5])
robot.screen.print(sum_result)
# sum_result = 15
# Calculate the sum of a list with a starting value of 10
sum_with_start = sum([1, 2, 3], 10)
robot.screen.print(sum_with_start)
# sum_with_start = 16
divmod#
divmod ഒരു ഹരണ പ്രവർത്തനത്തിന്റെ ഘടകവും ശിഷ്ടവും അടങ്ങിയ ഒരു ട്യൂപ്പിൾ നൽകുന്നു.
Usage:
divmod(a, b)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ലാഭവിഹിതം. |
|
ഹരിക്കൽ ഘടകം. |
# Perform integer division and remainder of 10 / 3
divmod_result = divmod(10, 3)
robot.screen.print(divmod_result)
# divmod_result = (3, 1)
pow#
pow ഒരു സംഖ്യയെ ഒരു പവറിലേക്ക് ഉയർത്തുകയും ഓപ്ഷണലായി ഒരു മോഡുലസ് പ്രവർത്തനം നടത്തുകയും ചെയ്യുന്നു.
Usage:
pow(x, y, mod)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
അടിസ്ഥാന സംഖ്യ. |
|
ഘാതം. |
|
ഓപ്ഷണൽ. ഒരു മോഡുലസ് മൂല്യം. നൽകിയിട്ടുണ്ടെങ്കിൽ, |
# Calculate 2 raised to the power of 3
pow_result = pow(2, 3)
robot.screen.print(pow_result)
# pow_result = 8
# Calculate (5 ** 3) % 7
pow_mod_result = pow(5, 3, 7)
robot.screen.print(pow_mod_result)
# pow_mod_result = 6
int#
int ഒരു സംഖ്യയെയോ സ്ട്രിങ്ങിനെയോ പൂർണ്ണസംഖ്യയാക്കി മാറ്റുന്നു. ഒരു സ്ട്രിങ്ങിൽ നിന്ന് പരിവർത്തനം ചെയ്യുമ്പോൾ ഇത് അടിസ്ഥാന പരിവർത്തനത്തെയും പിന്തുണയ്ക്കുന്നു.
Usage:
int(x, base)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
പരിവർത്തനം ചെയ്യാനുള്ള ഒരു നമ്പർ, സ്ട്രിംഗ് അല്ലെങ്കിൽ മറ്റ് വസ്തു. |
|
ഓപ്ഷണൽ. പരിവർത്തനത്തിനായി ഉപയോഗിക്കേണ്ട സംഖ്യാ അടിസ്ഥാനം. ഡിഫോൾട്ട് 10 ആണ്. |
# Convert a float to an integer to get rid of decimals
price = 19.99
price_int = int(price)
robot.screen.print(f"{price_int} coins")
# Output: 19 coins
# Convert a string into an integer to use in calculations
user_input = "55"
user_number = int(user_input)
robot.screen.print(user_number * 2)
# Output: 110
float#
float ഒരു സംഖ്യയെയോ സ്ട്രിംഗിനെയോ ഒരു ഫ്ലോട്ടിംഗ്-പോയിന്റ് സംഖ്യയാക്കി മാറ്റുന്നു.
Usage:
float(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
പരിവർത്തനം ചെയ്യാനുള്ള ഒരു നമ്പർ, സ്ട്രിംഗ് അല്ലെങ്കിൽ മറ്റ് വസ്തു. |
# Convert division result to a float
num_apples = 6
num_people = 2
apples_per_person = float(num_apples) / num_people
robot.screen.print(apples_per_person)
# Output: 3.00
# Convert a string into a float to use in calculations
user_input = "23.4"
user_number = float(user_input)
robot.screen.print(user_number * 3)
# Output: 70.20
ഗണിത മൊഡ്യൂൾ#
മൈക്രോപൈത്തണിലെ math മൊഡ്യൂൾ സാധാരണ ഗണിത കണക്കുകൂട്ടലുകൾ നടത്തുന്നതിനുള്ള അധിക രീതികൾ നൽകുന്നു. ഈ രീതികളിൽ ത്രികോണമിതി, ലോഗരിഥമിക്, മറ്റ് സംഖ്യാ പ്രവർത്തനങ്ങൾ എന്നിവ ഉൾപ്പെടുന്നു.
math മൊഡ്യൂൾ VEXcode-ൽ ഡിഫോൾട്ടായി ഇറക്കുമതി ചെയ്യപ്പെടുന്നു.
Constants#
ഒരു പ്രോജക്റ്റ് സമയത്ത് സ്ഥിരമായി നിലനിൽക്കുന്ന മുൻകൂട്ടി നിശ്ചയിച്ച മൂല്യങ്ങളാണ് സ്ഥിരാങ്കങ്ങൾ. നിർവചനമോ അസൈൻമെന്റോ ആവശ്യമില്ലാതെ തന്നെ കണക്കുകൂട്ടലുകളിൽ അവ ഉപയോഗിക്കാൻ കഴിയും.
പൈ#
pi എന്നത് ഗണിത സ്ഥിരാങ്കം π നൽകുന്നു, ഇത് ഒരു വൃത്തത്തിന്റെ ചുറ്റളവും വ്യാസവും തമ്മിലുള്ള അനുപാതമാണ്.
Usage:
math.pi
# Calculate the area of a circle with radius 5 using pi
circle_area = math.pi * 5 * 5
robot.screen.print(circle_area)
# circle_area = 78.54
ടൗ#
tau 2π ന്റെ മൂല്യം നൽകുന്നു.
Usage:
math.tau
# Calculate the circumference of a circle with radius
circumference = math.tau * 5
robot.screen.print(circumference)
# circumference = 31.42
ഇ#
e സ്വാഭാവിക ലോഗരിതത്തിന്റെ അടിസ്ഥാനം നൽകുന്നു.
Usage:
math.e
# Calculate e raised to the power of 2
e_power = math.pow(math.e, 2)
robot.screen.print(e_power)
# e_power = 7.39
ഇൻഫ്#
inf ഒരു ഫ്ലോട്ട് ആയി പോസിറ്റീവ് ഇൻഫിനിറ്റി നൽകുന്നു.
Usage:
math.inf
# Check if infinity is infinite
inf_value = math.inf
if math.isinf(inf_value):
robot.screen.print("Infinity")
# Prints "Infinity"
നാൻ#
“നോട്ട് എ നമ്പർ” (NaN) എന്നതിനായുള്ള ഒരു പ്രത്യേക ഫ്ലോട്ടിനെ nan പ്രതിനിധീകരിക്കുന്നു.
Usage:
math.nan
# Check if nan is Not a Number
nan_value = math.nan
if math.isnan(nan_value):
robot.screen.print("Not a Number")
# Prints "Not a Number"
Trigonometry#
പാപം#
sin ഒരു കോണിന്റെ സൈൻ റേഡിയൻസിൽ കണക്കാക്കി ഒരു ഫ്ലോട്ട് തിരികെ നൽകുന്നു.
Usage:
math.sin(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
റേഡിയനുകളിൽ ഒരു കോണിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the sine of 30 degrees in radians
sine_result = math.sin(math.radians(30))
robot.screen.print(sine_result)
# sine_result = 0.50
കാരണം#
cos റേഡിയൻസിൽ ഒരു കോണിന്റെ കോസൈൻ കണക്കാക്കുകയും ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.cos(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
റേഡിയനുകളിൽ ഒരു കോണിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the cosine of 60 degrees in radians
cosine_result = math.cos(math.radians(60))
robot.screen.print(cosine_result)
# cosine_result = 0.50
ടാൻ#
tan റേഡിയൻസിൽ ഒരു കോണിന്റെ ടാൻജെന്റ് കണക്കാക്കുകയും ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.tan(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
റേഡിയനുകളിൽ ഒരു കോണിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the tangent of 45 degrees in radians
tangent_result = math.tan(math.radians(45))
robot.screen.print(tangent_result)
# tangent_result = 1.00
ആതൻ#
atan ഒരു സംഖ്യയുടെ വിപരീത ടാൻജെന്റ് (ആർക്ക് ടാൻജെന്റ്) കണക്കാക്കുകയും റേഡിയനുകളിൽ കോണിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.atan(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the arc tangent of 1 in degrees
arc_tangent_result = math.degrees(math.atan(1.0))
robot.screen.print(arc_tangent_result)
# arc_tangent_result = 45.00
അറ്റൻ2#
atan2 y/x ന്റെ വിപരീത ടാൻജെന്റിന്റെ പ്രിൻസിപ്പൽ മൂല്യം കണക്കാക്കുകയും റേഡിയനുകളിൽ കോണിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.atan2(y, x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
y-കോർഡിനേറ്റിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
|
x-കോർഡിനേറ്റിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the inverse tangent of 1/1 in degrees
atan2_result = math.degrees(math.atan2(1.0, 1.0))
robot.screen.print(atan2_result)
# atan2_result = 45.00
അസിൻ#
asin ഒരു സംഖ്യയുടെ വിപരീത സൈൻ (ആർക്ക് സൈൻ) കണക്കാക്കുകയും റേഡിയനുകളിൽ കോണിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.asin(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
-1 നും 1 നും ഇടയിലുള്ള ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the arc sine of 0.5 in degrees
arc_sine_result = math.degrees(math.asin(0.5))
robot.screen.print(arc_sine_result)
# arc_sine_result = 30.00
അക്കോസ്#
acos ഒരു സംഖ്യയുടെ വിപരീത കോസൈൻ (ആർക്ക് കോസൈൻ) കണക്കാക്കുകയും റേഡിയനുകളിൽ കോണിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.acos(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
-1 നും 1 നും ഇടയിലുള്ള ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the arc cosine of 0.5 in degrees
arc_cosine_result = math.degrees(math.acos(0.5))
robot.screen.print(arc_cosine_result)
# arc_cosine_result = 60.00
ഡിഗ്രികൾ#
degrees ഒരു കോണിനെ റേഡിയനുകളിൽ നിന്ന് ഡിഗ്രികളാക്കി മാറ്റുന്നു.
Usage:
math.degrees(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
റേഡിയനുകളിൽ ഒരു കോണിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Convert pi radians to degrees
degrees_result = math.degrees(math.pi)
robot.screen.print(degrees_result)
# degrees_result = 180.00
റേഡിയനുകൾ#
radians ഒരു കോണിനെ ഡിഗ്രിയിൽ നിന്ന് റേഡിയൻസാക്കി മാറ്റുന്നു.
Usage:
math.radians(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഡിഗ്രിയിൽ ഒരു കോണിനെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Convert 180 degrees to radians
radians_result = math.radians(180)
robot.screen.print(radians_result)
# radians_result = 3.14
Hyperbolics#
സിൻഹ്#
sinh x ന്റെ ഹൈപ്പർബോളിക് സൈൻ കണക്കാക്കുന്നു.
Usage:
math.sinh(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഇൻപുട്ട് മൂല്യത്തെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the hyperbolic sine of 1
sinh_result = math.sinh(1)
robot.screen.print(sinh_result)
# sinh_result = 1.18
കോഷ്#
cosh x ന്റെ ഹൈപ്പർബോളിക് കോസൈൻ കണക്കാക്കുന്നു.
Usage:
math.cosh(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഇൻപുട്ട് മൂല്യത്തെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the hyperbolic cosine of 1
cosh_result = math.cosh(1)
robot.screen.print(cosh_result)
# cosh_result = 1.54
ടാൻ#
tanh x ന്റെ ഹൈപ്പർബോളിക് ടാൻജെന്റ് കണക്കാക്കുന്നു.
Usage:
math.tanh(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഇൻപുട്ട് മൂല്യത്തെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the hyperbolic tangent of 1
tanh_result = math.tanh(1)
robot.screen.print(tanh_result)
# tanh_result = 0.76
അസിന്ഹ്#
asinh x ന്റെ വിപരീത ഹൈപ്പർബോളിക് സൈൻ കണക്കാക്കുന്നു.
Usage:
math.asinh(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഇൻപുട്ട് മൂല്യത്തെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the inverse hyperbolic sine of 1
asinh_result = math.asinh(1)
robot.screen.print(asinh_result)
# asinh_result = 0.88
അക്കോഷ്#
acosh x ന്റെ വിപരീത ഹൈപ്പർബോളിക് കോസൈൻ കണക്കാക്കുന്നു.
Usage:
math.acosh(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
1-നേക്കാൾ വലുതോ തുല്യമോ ആയ ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the inverse hyperbolic cosine of 2
acosh_result = math.acosh(2)
robot.screen.print(acosh_result)
# acosh_result = 1.32
അതാൻ#
atanh x ന്റെ വിപരീത ഹൈപ്പർബോളിക് ടാൻജെന്റ് കണക്കാക്കുന്നു.
Usage:
math.atanh(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
-1 നും 1 നും ഇടയിലുള്ള ഒരു ഫ്ലോട്ട് (എക്സ്ക്ലൂസീവ്). |
# Calculate the inverse hyperbolic tangent of 0.5
atanh_result = math.atanh(0.5)
robot.screen.print(atanh_result)
# atanh_result = 0.55
Rounding & Absolute Values#
സീൽ#
ceil ഒരു സംഖ്യയെ ഏറ്റവും അടുത്തുള്ള പൂർണ്ണസംഖ്യയിലേക്ക് റൗണ്ട് ചെയ്യുന്നു.
Usage:
math.ceil(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
റൗണ്ട് അപ്പ് ചെയ്യേണ്ട ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Round 3.7 up to the nearest integer
ceil_result = math.ceil(3.7)
robot.screen.print(ceil_result)
# ceil_result = 4
തറ#
floor ഒരു സംഖ്യയെ ഏറ്റവും അടുത്തുള്ള പൂർണ്ണസംഖ്യയിലേക്ക് റൗണ്ട് ചെയ്യുന്നു.
Usage:
math.floor(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
റൗണ്ട് ഡൌൺ ചെയ്യേണ്ട ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Round 3.7 down to the nearest integer
floor_result = math.floor(3.7)
robot.screen.print(floor_result)
# floor_result = 3
തുമ്പ്#
trunc ഒരു സംഖ്യയുടെ ദശാംശ ഭാഗം റൗണ്ടിംഗ് ഇല്ലാതെ നീക്കം ചെയ്യുന്നു.
Usage:
math.trunc(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
വെട്ടിച്ചുരുക്കേണ്ട ഒരു ഫ്ലോട്ട്. |
# Remove the decimal part of 3.7
trunc_result = math.trunc(3.7)
robot.screen.print(trunc_result)
# trunc_result = 3
ഫാബ്സ്#
fabs ഒരു സംഖ്യയുടെ കേവല മൂല്യം ഫ്ലോട്ടായി നൽകുന്നു.
Usage:
math.fabs(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Get the absolute value of -3.7
fabs_result = math.fabs(-3.7)
robot.screen.print(fabs_result)
# fabs_result = 3.70
Exponents & Logarithms#
പവ്#
pow , x നെ y യുടെ ശക്തിയിലേക്ക് ഉയർത്തുകയും ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു, രണ്ട് ഇൻപുട്ടുകളും പൂർണ്ണസംഖ്യകളാണെങ്കിൽ പോലും.
Usage:
math.pow(x, y)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യാ ബേസ്. |
|
ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ എക്സ്പോണന്റ്. |
# Calculate 2 raised to the power of 3
power_result = math.pow(2, 3)
robot.screen.print(power_result)
# power_result = 8.00
ചതുരശ്രം#
sqrt ഒരു സംഖ്യയുടെ വർഗ്ഗമൂലം കണക്കാക്കുകയും പൂർണ്ണ വർഗ്ഗങ്ങൾക്ക് പോലും ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.sqrt(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു നോൺ-നെഗറ്റീവ് ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the square root of 16
sqrt_result = math.sqrt(16)
robot.screen.print(sqrt_result)
# sqrt_result = 4.00
എക്സ്പ്രഷൻ#
exp ഒരു സംഖ്യയുടെ എക്സ്പോണൻഷ്യൽ കണക്കാക്കുകയും ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.exp(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate e raised to the power of 1
exp_result = math.exp(1)
robot.screen.print(exp_result)
# exp_result = 2.72
ലോഗ്#
log ഒരു സംഖ്യയുടെ സ്വാഭാവിക ലോഗരിതം കണക്കാക്കുകയും ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.log(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു പോസിറ്റീവ് ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the natural logarithm (base e) of 7.389056
log_result = math.log(7.389056)
robot.screen.print(log_result)
# log_result = 2.00
ലോഗ്10#
log10 ഒരു സംഖ്യയുടെ ബേസ്-10 ലോഗരിതം കണക്കാക്കുകയും ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു.
Usage:
math.log10(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു പോസിറ്റീവ് ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the base-10 logarithm of 1000
log10_result = math.log10(1000)
robot.screen.print(log10_result)
# log10_result = 3.00
ലോഗ്2#
log2 ഒരു സംഖ്യയുടെ ബേസ്-2 ലോഗരിതം കണക്കാക്കുകയും ഒരു ഫ്ലോട്ട് തിരികെ നൽകുകയും ചെയ്യുന്നു, x എന്നത് 2 ന്റെ ഒരു പവറാണെങ്കിൽ പോലും.
Usage:
math.log2(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു പോസിറ്റീവ് ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the base-2 logarithm of 8
log2_result = math.log2(8)
robot.screen.print(log2_result)
# log2_result = 3.00
ഫാക്ടോറിയൽ#
factorial ഒരു പൂർണ്ണസംഖ്യയായ xന്റെ ഫാക്റ്റോറിയൽ നൽകുന്നു, ഇത് x വരെയുള്ള എല്ലാ പോസിറ്റീവ് പൂർണ്ണസംഖ്യകളുടെയും ഗുണനഫലമാണ്.
Usage:
math.factorial(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
നെഗറ്റീവ് അല്ലാത്ത ഒരു പൂർണ്ണസംഖ്യ. |
# Calculate 5 factorial (5!)
factorial_result = math.factorial(5)
robot.screen.print(factorial_result)
# factorial_result = 120
എക്സ്പിഎം1#
expm1 ex - 1കണക്കാക്കുന്നു, ഇത് ചെറിയ x ന് കൂടുതൽ കൃത്യമാണ്.
Usage:
math.expm1(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഘാതാംഗ മൂല്യം. |
# Compute expm1(1) (e^1 - 1)
expm1_result = math.expm1(1)
robot.screen.print(expm1_result)
# expm1_result = 1.72
Floating Point Operations#
പരിഷ്കരണം#
modf ഒരു സംഖ്യയെ അതിന്റെ ഭിന്നസംഖ്യ, പൂർണ്ണസംഖ്യ ഭാഗങ്ങളായി വിഘടിപ്പിച്ച് ഒരു ട്യൂപ്പിൾ (fractional part, integer part)തിരികെ നൽകുന്നു, രണ്ടും ഫ്ലോട്ടുകളായി.
Usage:
math.modf(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
വിഘടിപ്പിക്കാനുള്ള ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Decompose 3.14159 into fractional and integer parts
fractional_part, integer_part = math.modf(3.14159)
robot.screen.print(fractional_part)
robot.screen.next_row()
robot.screen.print(integer_part)
# fractional_part = 0.14
# integer_part = 3.00
ഫ്രെക്സ്പ്#
frexp ഒരു സംഖ്യയെ അതിന്റെ മാന്റിസ്സയായും എക്സ്പോണന്റായും വിഘടിപ്പിച്ച് ഒരു ട്യൂപ്പിൾ (mantissa, exponent)നൽകുന്നു, ഇവിടെ മാന്റിസ്സ ഒരു ഫ്ലോട്ടും എക്സ്പോണന്റ് ഒരു പൂർണ്ണസംഖ്യയുമാണ്.
Usage:
math.frexp(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
വിഘടിപ്പിക്കാനുള്ള ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Decompose 16 into its mantissa and exponent
mantissa, exponent = math.frexp(16)
robot.screen.print(mantissa)
robot.screen.next_row()
robot.screen.print(exponent)
# mantissa = 0.50
# exponent = 5
എഫ്എംഒഡി#
fmod ഡിവിഡന്റിന്റെ ചിഹ്നം (x ) നിലനിർത്തിക്കൊണ്ട് ഹരിച്ചലിന്റെ ബാക്കി ഭാഗം നൽകുന്നു.
Usage:
math.fmod(x, y)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ലാഭവിഹിതം. |
|
ഹരിക്കൽ ഘടകം. |
# Calculate remainder of 10 / 3
# that preserves the sign of 10
fmod_result = math.fmod(10, 3)
robot.screen.print(fmod_result)
# fmod_result = 1.00
പകർപ്പ് ചിഹ്നം#
copysign y എന്ന ചിഹ്നത്തോടെ x തിരികെ നൽകുന്നു.
Usage:
math.copysign(x, y)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
പരിഷ്ക്കരിക്കേണ്ട മൂല്യം. |
|
ചിഹ്നം പകർത്തേണ്ട മൂല്യം. |
# Return -10 with the sign of 3 (positive)
copysign_result = math.copysign(-10, 3)
robot.screen.print(copysign_result)
# copysign_result = 10.00
ldexp GenericName#
ldexp x * (2 ** exp)കണക്കാക്കുന്നു, ഇത് x * 2exp{code} ന് തുല്യമാണ്.
Usage:
math.ldexp(x, exp)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
അടിസ്ഥാന മൂല്യം. |
|
ഘാതം. |
# Compute 3 * (2 ** 4)
ldexp_result = math.ldexp(3, 4)
robot.screen.print(ldexp_result)
# ldexp_result = 48.00
Comparison & Approximation#
അടുത്ത്#
ഒരു ടോളറൻസിനുള്ളിൽ രണ്ട് സംഖ്യകൾ ഏകദേശം തുല്യമാണോ എന്ന് isclose പരിശോധിക്കുന്നു.
Usage:
math.isclose(a, b, rel_tol, abs_tol)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
താരതമ്യം ചെയ്യേണ്ട ആദ്യ സംഖ്യ. |
|
താരതമ്യം ചെയ്യാനുള്ള രണ്ടാമത്തെ സംഖ്യ. |
|
ഓപ്ഷണൽ. a യും b യും തമ്മിലുള്ള പരമാവധി അനുവദനീയമായ വ്യത്യാസം, അവയുടെ വലുപ്പവുമായി താരതമ്യപ്പെടുത്തുമ്പോൾ. ഡിഫോൾട്ട് 1e-09 ആണ് (വളരെ ചെറുത്). |
|
ഓപ്ഷണൽ. പൂജ്യത്തിനടുത്തുള്ള സംഖ്യകളെ താരതമ്യം ചെയ്യുമ്പോൾ ഉപയോഗപ്രദമാകുന്ന ഒരു നിശ്ചിത മാർജിൻ പിശക്. സ്ഥിരസ്ഥിതി 0.0 ആണ്. |
കുറിപ്പ്: rel_tol ഉം abs_tol ഉം നൽകിയിട്ടുണ്ടെങ്കിൽ, ഏത് വ്യവസ്ഥയാണ് ആദ്യം പാലിക്കുന്നത് അത് ഫലം നിർണ്ണയിക്കുന്നു.
# Check if 1.000000001 and 1.0 are close
# within the default tolerance
isclose_result = math.isclose(1.000000001, 1.0)
robot.screen.print(isclose_result)
# isclose_result = True
# Check if 0.0000001 and 0.0 are close
# using absolute tolerance
isclose_result = math.isclose(0.0000001, 0.0, abs_tol=1e-07)
robot.screen.print(isclose_result)
# isclose_result = True
# Check if 1000000.0 and 1000000.1 are close
# with a stricter tolerance
isclose_result = math.isclose(1000000.0, 1000000.1, rel_tol=1e-10)
robot.screen.print(isclose_result)
# isclose_result = False
അനന്തമാണ്#
ഒരു സംഖ്യ പരിമിതമാണോ എന്ന് isfinite പരിശോധിക്കുന്നു. ഈ രീതി ഒരു ബൂളിയൻ മൂല്യം നൽകുന്നു:
True– സംഖ്യ പരിമിതമാണ്.False– സംഖ്യ അനന്തമാണ്.
Usage:
math.isfinite(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
പരിശോധിക്കാനുള്ള ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Check if 42 is a finite number (returns True)
is_finite_true = math.isfinite(42)
robot.screen.print(is_finite_true)
# is_finite_true = True
# Check if infinity is a finite number (returns False)
is_finite_false = math.isfinite(math.inf)
robot.screen.print(is_finite_false)
# is_finite_false = False
ഐഎസ്ഐഎൻഎഫ്#
ഒരു സംഖ്യ അനന്തമാണോ എന്ന് isinf പരിശോധിക്കുന്നു. ഈ രീതി ഒരു ബൂളിയൻ മൂല്യം നൽകുന്നു:
True– സംഖ്യ അനന്തമാണ്.False– സംഖ്യ പരിമിതമാണ്.
Usage:
math.isinf(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
പരിശോധിക്കാനുള്ള ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Check if infinity is an infinite number (returns True)
is_inf_true = math.isinf(math.inf)
robot.screen.print(is_inf_true)
# is_inf_true = True
# Check if 42 is an infinite number (returns False)
is_inf_false = math.isinf(42)
robot.screen.print(is_inf_false)
# is_inf_false = False
ഇസ്നാൻ#
ഒരു സംഖ്യ NaN (ഒരു സംഖ്യയല്ല) ആണോ എന്ന് isnan പരിശോധിക്കുന്നു. ഈ രീതി ഒരു ബൂളിയൻ മൂല്യം നൽകുന്നു:
True– സംഖ്യ NaN ആണ്.False– നമ്പർ ഒരു സാധുവായ സംഖ്യയാണ്.
Usage:
math.isnan(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
പരിശോധിക്കാനുള്ള ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Check if NaN (Not a Number) is NaN (returns True)
is_nan_true = math.isnan(math.nan)
robot.screen.print(is_nan_true)
# is_nan_true = True
# Check if 42 is NaN (returns False)
is_nan_false = math.isnan(42)
robot.screen.print(is_nan_false)
# is_nan_false = False
Error and Gamma Calculations#
ഗാമ#
gamma xന്റെ ഗാമ ഫംഗ്ഷൻ കണക്കാക്കുന്നു, ഇത് യഥാർത്ഥ സംഖ്യകൾക്കും സങ്കീർണ്ണ സംഖ്യകൾക്കും ഫാക്റ്റോറിയൽ ഫംഗ്ഷനെ സാമാന്യവൽക്കരിക്കുന്നു. ഒരു പൂർണ്ണസംഖ്യ nന്, gamma(n) = (n-1)!.
Usage:
math.gamma(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു പോസിറ്റീവ് ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the gamma function of 5 (equivalent to 4!)
gamma_result = math.gamma(5)
robot.screen.print(gamma_result)
# gamma_result = 24.00
എൽഗാമ#
lgamma gamma ഫംഗ്ഷന്റെ സ്വാഭാവിക ലോഗരിതം കണക്കാക്കുന്നു.
Usage:
math.lgamma(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഒരു പോസിറ്റീവ് ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the natural logarithm of the
# gamma function of 5
lgamma_result = math.lgamma(5)
robot.screen.print(lgamma_result)
# lgamma_result = 3.18
ഇആർഎഫ്#
erf x ന്റെ പിശക് ഫംഗ്ഷൻ കണക്കാക്കുന്നു.
Usage:
math.erf(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഇൻപുട്ട് മൂല്യത്തെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the error function of 1
erf_result = math.erf(1)
robot.screen.print(erf_result)
# erf_result = 0.84
ഇ.ആർ.എഫ്.സി.#
erfc xന്റെ പൂരക പിശക് ഫംഗ്ഷൻ കണക്കാക്കുന്നു, ഇത് 1 - erf(x) ആയി നിർവചിച്ചിരിക്കുന്നു.
Usage:
math.erfc(x)
പാരാമീറ്റർ |
വിവരണം |
|---|---|
|
ഇൻപുട്ട് മൂല്യത്തെ പ്രതിനിധീകരിക്കുന്ന ഒരു ഫ്ലോട്ട് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ. |
# Calculate the complementary error function of 1
erfc_result = math.erfc(1)
robot.screen.print(erfc_result)
# erfc_result = 0.16