diff --git a/src/Lib/Math.php b/src/Lib/Math.php index 72d9f50..f7cacb7 100644 --- a/src/Lib/Math.php +++ b/src/Lib/Math.php @@ -8,6 +8,10 @@ class Math implements ILib { public function register(Env $env): void { + // Constants + + $env->set('pi', \M_PI); + // Basic arithmetic $env->set('+', new CoreFunc('+', 'Return the sum of all arguments.', 1, -1, diff --git a/src/Lib/Strings.php b/src/Lib/Strings.php index 2537050..4b1679c 100644 --- a/src/Lib/Strings.php +++ b/src/Lib/Strings.php @@ -9,6 +9,8 @@ class Strings implements ILib { public function register(Env $env): void { + $env->set('ln', \PHP_EOL); + $env->set('trim', new CoreFunc('trim', 'Remove whitespace from beginning and end of string.', 1, 1, fn (string $a) => trim($a) ));