cvs: php4 /pear/Math Fraction.php
| From: | Sebastian Bergmann | Date: | Wed, 14 Nov 2001 08:01:21 +0000 |
| Subject: | cvs: php4 /pear/Math Fraction.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1316@lists.php.net to get a copy of this message | ||
sebastian Wed Nov 14 03:01:21 2001 EDT
Modified files:
/php4/pear/Math Fraction.php
Log:
Hopefully fix this.
Index: php4/pear/Math/Fraction.php
diff -u php4/pear/Math/Fraction.php:1.4 php4/pear/Math/Fraction.php:1.5
--- php4/pear/Math/Fraction.php:1.4 Fri Aug 24 17:51:03 2001
+++ php4/pear/Math/Fraction.php Wed Nov 14 03:01:21 2001
@@ -16,7 +16,7 @@
// | Authors: Sebastian Bergmann <sb@sebastian-bergmann.de> |
// +----------------------------------------------------------------------+
//
-// $Id: Fraction.php,v 1.4 2001/08/24 21:51:03 mj Exp $
+// $Id: Fraction.php,v 1.5 2001/11/14 08:01:21 sebastian Exp $
//
/**
@@ -34,7 +34,7 @@
* $a->add( $b );
*
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
-* @version $Revision: 1.4 $
+* @version $Revision: 1.5 $
* @access public
* @package Numbers
*/
@@ -89,8 +89,9 @@
{
$fraction = $this->_check_fraction($fraction);
- $result = new Math_Fraction(($this->numerator + $fraction->numerator),
- ($this->denominator * $fraction->denominator)
+ $result = new Math_Fraction((($this->numerator * $fraction->denominator) +
+ ($this->denominator * $fraction->numerator)),
+ ($this->denominator * $fraction->denominator)
);
return $this->_return($result, $overwrite_with_result);
@@ -110,8 +111,9 @@
{
$fraction = $this->_check_fraction($fraction);
- $result = new Math_Fraction(($this->numerator - $fraction->numerator),
- ($this->denominator * $fraction->denominator)
+ $result = new Math_Fraction((($this->numerator * $fraction->denominator) -
+ ($this->denominator * $fraction->numerator)),
+ ($this->denominator * $fraction->denominator)
);
return $this->_return($result, $overwrite_with_result);