ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Logarithms.php
Go to the documentation of this file.
1<?php
2
4
6
8{
22 public static function withBase($number, $base = 10)
23 {
24 try {
25 $number = Helpers::validateNumericNullBool($number);
29 } catch (Exception $e) {
30 return $e->getMessage();
31 }
32
33 return log($number, $base);
34 }
35
45 public static function base10($number)
46 {
47 try {
48 $number = Helpers::validateNumericNullBool($number);
50 } catch (Exception $e) {
51 return $e->getMessage();
52 }
53
54 return log10($number);
55 }
56
66 public static function natural($number)
67 {
68 try {
69 $number = Helpers::validateNumericNullBool($number);
71 } catch (Exception $e) {
72 return $e->getMessage();
73 }
74
75 return log($number);
76 }
77}
An exception for terminatinating execution or to throw for unit testing.
static validateNumericNullBool($number)
Many functions accept null/false/true argument treated as 0/0/1.
Definition: Helpers.php:27
static validatePositive($number, ?string $except=null)
Confirm number > 0.
Definition: Helpers.php:83
static withBase($number, $base=10)
LOG_BASE.
Definition: Logarithms.php:22
$base
Definition: index.php:4