Subversion Repositories oidplus

Rev

Rev 846 | Rev 1042 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 846 Rev 874
Line 3... Line 3...
3
/**
3
/**
4
 * Pure-PHP 32-bit BigInteger Engine
4
 * Pure-PHP 32-bit BigInteger Engine
5
 *
5
 *
6
 * PHP version 5 and 7
6
 * PHP version 5 and 7
7
 *
7
 *
-
 
8
 * @category  Math
-
 
9
 * @package   BigInteger
8
 * @author    Jim Wigginton <terrafrost@php.net>
10
 * @author    Jim Wigginton <terrafrost@php.net>
9
 * @copyright 2017 Jim Wigginton
11
 * @copyright 2017 Jim Wigginton
10
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
12
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
11
 * @link      http://pear.php.net/package/Math_BigInteger
13
 * @link      http://pear.php.net/package/Math_BigInteger
12
 */
14
 */
Line 16... Line 18...
16
/**
18
/**
17
 * Pure-PHP 32-bit Engine.
19
 * Pure-PHP 32-bit Engine.
18
 *
20
 *
19
 * Uses 64-bit floats if int size is 4 bits
21
 * Uses 64-bit floats if int size is 4 bits
20
 *
22
 *
-
 
23
 * @package PHP32
21
 * @author  Jim Wigginton <terrafrost@php.net>
24
 * @author  Jim Wigginton <terrafrost@php.net>
-
 
25
 * @access  public
22
 */
26
 */
23
class PHP32 extends PHP
27
class PHP32 extends PHP
24
{
28
{
25
    // Constants used by PHP.php
29
    // Constants used by PHP.php
26
    const BASE = 26;
30
    const BASE = 26;
Line 241... Line 245...
241
     *
245
     *
242
     * {@internal Could return $this->subtract($x), but that's not as fast as what we do do.}
246
     * {@internal Could return $this->subtract($x), but that's not as fast as what we do do.}
243
     *
247
     *
244
     * @param PHP32 $y
248
     * @param PHP32 $y
245
     * @return int in case < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
249
     * @return int in case < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
-
 
250
     * @access public
246
     * @see self::equals()
251
     * @see self::equals()
247
     */
252
     */
248
    public function compare(PHP32 $y)
253
    public function compare(PHP32 $y)
249
    {
254
    {
250
        return $this->compareHelper($this->value, $this->is_negative, $y->value, $y->is_negative);
255
        return $this->compareHelper($this->value, $this->is_negative, $y->value, $y->is_negative);