Refactored to 2 namespaces: Wootook & Legacies
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
parent
cfeb6aca6d
commit
ec7e40e1aa
1004 changed files with 4808 additions and 2971 deletions
97
application/code/libraries/Math/Native.php
Normal file
97
application/code/libraries/Math/Native.php
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> NOTICE <--
|
||||
* This file is part of the core development branch, changing its contents will
|
||||
* make you unable to use the automatic updates manager. Please refer to the
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
* @author Greg
|
||||
*
|
||||
*/
|
||||
|
||||
class Math_Native
|
||||
{
|
||||
public function setPrecision($precision)
|
||||
{
|
||||
}
|
||||
|
||||
public function add($a, $b)
|
||||
{
|
||||
return $a + $b;
|
||||
}
|
||||
|
||||
public function mul($a, $b)
|
||||
{
|
||||
return $a * $b;
|
||||
}
|
||||
|
||||
public function sub($a, $b)
|
||||
{
|
||||
return $a - $b;
|
||||
}
|
||||
|
||||
public function div($a, $b)
|
||||
{
|
||||
return $a / $b;
|
||||
}
|
||||
|
||||
public function mod($a, $b)
|
||||
{
|
||||
return $a % $b;
|
||||
}
|
||||
|
||||
public function pow($a, $b)
|
||||
{
|
||||
return pow($a, $b);
|
||||
}
|
||||
|
||||
public function comp($a, $b)
|
||||
{
|
||||
return ($a > $b) ? 1 : (($a < $b) ? -1 : 0);
|
||||
}
|
||||
|
||||
public function ceil($x)
|
||||
{
|
||||
return ceil($x);
|
||||
}
|
||||
|
||||
public function floor($x)
|
||||
{
|
||||
return floor($x);
|
||||
}
|
||||
|
||||
public function round($range = 0)
|
||||
{
|
||||
return round($x, $range);
|
||||
}
|
||||
|
||||
public function render($a)
|
||||
{
|
||||
return number_format($a, 0, ',', '.');
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue