Bug 1147703 - floating point under/overflows prevent unit conversion
Summary: floating point under/overflows prevent unit conversion
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: units
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-29 22:16 UTC by Przemek Klosowski
Modified: 2014-11-10 06:20 UTC (History)
3 users (show)

Fixed In Version: units-2.11-4.fc21
Clone Of:
Environment:
Last Closed: 2014-10-22 08:53:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Przemek Klosowski 2014-09-29 22:16:38 UTC
Description of problem: relatively simple units result in 
Unit reduction error (bad unit definition)

Version-Release number of selected component (if applicable):
units-2.02-3.fc20.x86_64


How reproducible: Every time


Steps to Reproduce:
1. run units on the commandline
2. type input :  
sigma^3


Actual results: error message:
Unit reduction error (bad unit definition)

Expected results: no error


Additional info:
This probably results from underflow in floating point calculations. sigma is defined as pi^2 k^4 / 60 hbar^3 c^2 and even small powers result in unfortunate under/overflows.

Comment 1 Kamil Dudka 2014-10-08 14:52:45 UTC
Sorry for the delay, I have been on vacation.  The error no longer occurs with units-2.11-3.fc22.  Is the following a correct response?

$ units
Currency exchange rates from www.timegenie.com on 2014-04-02 
2866 units, 109 prefixes, 79 nonlinear units

You have: sigma^3
You want: 
        Definition: 1.8232019e-22 kg^3 / K^12 s^9

Comment 2 Przemek Klosowski 2014-10-08 17:07:52 UTC
I believe that is correct.

Comment 3 Kamil Dudka 2014-10-08 17:30:56 UTC
Thanks for the confirmation!  I will submit an update of units for Fedora 20.

Comment 4 Kamil Dudka 2014-10-10 12:12:23 UTC
AFAIK, the upstream of units provides no SCM repository to pick the fix from, and there were too many changes between units-2.02 and units-2.11 (fixes, enhancements, indentation changes, ...):

$ diff -up ./units-2.02/units.c ./units-2.11/units.c | diffstat
 units.c | 3639 ++++++++++++++++++++++++++++++++++++++++++----------------------
 1 file changed, 2415 insertions(+), 1224 deletions(-)

So I will just rebase units in Fedora 20 to the version we have in Fedora 21...

Comment 5 Fedora Update System 2014-10-10 13:11:50 UTC
units-2.11-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/units-2.11-1.fc20

Comment 6 Fedora Update System 2014-10-11 06:57:07 UTC
Package units-2.11-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing units-2.11-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-12629/units-2.11-1.fc20
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-10-13 10:16:05 UTC
units-2.11-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/units-2.11-2.fc20

Comment 8 Fedora Update System 2014-10-13 10:16:12 UTC
units-2.11-4.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/units-2.11-4.fc21

Comment 9 lnie 2014-10-14 02:59:14 UTC
units-2.11-2.fc20 works

Comment 10 Fedora Update System 2014-10-22 08:53:48 UTC
units-2.11-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2014-11-10 06:20:46 UTC
units-2.11-4.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.