Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.1

Bug #11615 small bug in Math_FractionOp::stringToFraction
Submitted: 2007-07-16 18:09 UTC
From: aleph Assigned: kouber
Status: Closed Package: Math_Fraction (version 0.4.0)
PHP Version: 5.2.1 OS: Win 2000
Roadmaps: (Not assigned)    

 [2007-07-16 18:09 UTC] aleph (Carsten Mente)
Description: ------------ Converting strings to fractions in the following "-3/4" does not work. It seems that the - sign is not matched by the regex in Math_FractionOp::stringToFraction. Test script: --------------- <?php #require_once 'Math/FractionOp.php'; require_once 'FractionOp.php'; //does work: $t=Math_FractionOp::stringToFraction("1/2"); echo $t->toString(); //does not: $t=Math_FractionOp::stringToFraction("-1/2"); echo $t->toString(); ?> Expected result: ---------------- the first echo prints 1/2, the second should print -1/2. Actual result: -------------- the first echo prints 1/2, the second leads to an error or (depending on server configuration) to no output.


 [2007-07-18 15:00 UTC] kouber (Kouber Saparev)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.