* Reorganize files in TestSuite dir for multiple languages * Add SPython samples to TestSuite * Update TestRunner to support multiple languages * Delete dll files accidentally pushed * Update .gitignore * Revert "Delete dll files accidentally pushed" This reverts commit 62bcba2b821d58ae51ec98e9dadcf621bb0fc003. * Update testing dir path in Testing.cs * Improve TestRunner output * Add random module and it's usage sample * Reorganize gitignore files * Move pascal tests back to TestSuite and create new TestSuiteLanguagePlugins folder for SPython * Revert "Update testing dir path in Testing.cs" This reverts commit 7d94eafb25292421bce8315520b4f6a0de001bbd. * Revert crlf changes in pascal tests * Test changes of _RebuildReleaseAndRunTestsForGitHubActions.bat * Revert "Test changes of _RebuildReleaseAndRunTestsForGitHubActions.bat" This reverts commit 234ceae3e3a339fbc68a6170e2bd201dab14d67d. * Test changes in StorageLocationPicker * Another test changes in StorageLocationPicker.cs * Rename LanguagePlugins folder to AdditionalLanguages * Decouple TestRunner from language names and parameters * Revert calling TestRunner without parameters in .bat files * Fix formatter tests nogui exception handling * Small refactoring in Testing.cs and TestRunner fix of working directory
100 lines
2 KiB
Plaintext
100 lines
2 KiB
Plaintext
import PABCSystem
|
|
|
|
pi = 3.14
|
|
|
|
def sqrt(x: float) -> float:
|
|
return PABCSystem.sqrt(x)
|
|
|
|
def trunc(x: float) -> int:
|
|
return PABCSystem.trunc(x)
|
|
|
|
def floor(x: float) -> int:
|
|
return PABCSystem.floor(x)
|
|
|
|
def ceil(x: float) -> int:
|
|
return PABCSystem.ceil(x)
|
|
|
|
def log(x: float) -> float:
|
|
return PABCSystem.Log(x)
|
|
|
|
def log1p(x: float) -> float:
|
|
return PABCSystem.Log(1+ x)
|
|
|
|
def log2(x: float) -> float:
|
|
return PABCSystem.Log2(x)
|
|
|
|
def log10(x: float) -> float:
|
|
return PABCSystem.Log10(x)
|
|
|
|
def log(x: float, base: int) -> float:
|
|
return PABCSystem.LogN(base, x)
|
|
|
|
def exp(x: float) -> float:
|
|
return PABCSystem.exp(x)
|
|
|
|
def expm1(x: float) -> float:
|
|
return PABCSystem.exp(x - 1)
|
|
|
|
def exp2(x: float) -> float:
|
|
return PABCSystem.exp(log(2) * x)
|
|
|
|
def sin(x: float) -> float:
|
|
return PABCSystem.sin(x)
|
|
|
|
def sinh(x: float) -> float:
|
|
return PABCSystem.sinh(x)
|
|
|
|
def cos(x: float) -> float:
|
|
return PABCSystem.cos(x)
|
|
|
|
def cosh(x: float) -> float:
|
|
return PABCSystem.cosh(x)
|
|
|
|
def tan(x: float) -> float:
|
|
return PABCSystem.tan(x)
|
|
|
|
def tanh(x: float) -> float:
|
|
return PABCSystem.tanh(x)
|
|
|
|
def acos(x: float) -> float:
|
|
return PABCSystem.arccos(x)
|
|
|
|
def asin(x: float) -> float:
|
|
return PABCSystem.arcsin(x)
|
|
|
|
def atan(x: float) -> float:
|
|
return PABCSystem.arctan(x)
|
|
|
|
def atan2(y: float, x: float) -> float:
|
|
return PABCSystem.arctan(y / x)
|
|
|
|
def pow(x: float, y: int) -> float:
|
|
return PABCSystem.power(x, y)
|
|
|
|
def cbrt(x: float) -> float:
|
|
return pow(x, 1/3)
|
|
|
|
def fabs(x: float) -> float:
|
|
return PABCSystem.abs(x)
|
|
|
|
def pow(x: float, y: float) -> float:
|
|
return PABCSystem.power(x, y)
|
|
|
|
def isqrt(x: int) -> int:
|
|
return floor(sqrt(x))
|
|
|
|
def remainder(x: int, y: int) -> int:
|
|
return x - (x // y) * y
|
|
|
|
def factorial(n: int) -> int:
|
|
if n == 0:
|
|
return 1
|
|
return n * factorial(n - 1)
|
|
|
|
def perm(n: int, k: int) -> int:
|
|
return factorial(n) // factorial(n - k)
|
|
|
|
def comb(n: int, k: int) -> int:
|
|
return perm(n, k) // factorial(k)
|
|
|