FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16899&edit=1

ID: 16899
Updated by: jespinog@gmail.com
Reported By: bergie at iki dot fi
Summary: Pressure conversion from inHg to hPa calculated wrong
Status: Open
Type: Bug
Package: Services_Weather
Operating System: Linux
Package Version: 1.4.5
PHP Version: 5.2.5
Roadmap Versions:
New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2009-12-10 14:11:53] bergie

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

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 2, '10 at 6:26p
activeAug 2, '10 at 6:26p
posts1
users1
websitepear.php.net

1 user in discussion

Jespinog: 1 post

People

Translate

site design / logo © 2022 Grokbase