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

Bug #16899 Pressure conversion from inHg to hPa calculated wrong
Submitted: 2009-12-10 19:11 UTC
From: bergie Assigned: eru
Status: Closed Package: Services_Weather (version 1.4.5)
PHP Version: 5.2.5 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2009-12-10 19:11 UTC] bergie (Henri Bergius)
Description: ------------ Converting pressure from 29.92 inHg (the standard atmospheric pressure) to hPa returns 1013.21, while correct would be 1013.25. Reverse (hPa to inHg) works correctly. Test script: --------------- Services_Weather_Common::convertPressure(1013.25, 'hpa', 'in'); Expected result: ---------------- Returns 1013.25 Actual result: -------------- Returns 1013.21

Comments

 [2010-08-02 22:26 UTC] jespino (Jesús Espino)
That is not a bug, is a precision problem, 1013.25 hPa is 29.9212725, no 29.92. then 29.92 is 1013.20749904 (rounded to 1013.21) and 29.9212725 is 1013.2505908362075 (rounded to 1013.25) The function convertPressure round the result, but internaly all is ok.
 [2011-07-26 20:00 UTC] eru (Alexander Wirtz)
-Status: Open +Status: Closed -Assigned To: +Assigned To: eru
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net 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. Thanks for the report!