bugGNU Octave - Bugs: bug #38270, miscellaneous package: units...

 
 
Show feedback again

bug #38270: miscellaneous package: units conversion from degC to K fails with units 1.0

Submitted by:  None
Submitted on:  Wed 06 Feb 2013 07:24:32 AM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: ConfirmedAssigned to: None
Originator Name: ShaneOriginator Email: -unavailable-
Open/Closed: OpenRelease: 3.6.3
Operating System: Mac OS

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 20 Apr 2013 10:37:05 PM UTC, comment #5:

Michael Godfrey replied via email, reposting to tracker:

Conversion between degrees F and C and K are nonlinear conversions because 0 in one unit is not zero in another unit. See units(1) http://manpages.ubuntu.com/manpages/quantal/en/man1/units.1.html.

The Octave units function does not handle nonlinear conversions correctly, but that is a separate bug. This bug is about Octave throwing an error because it can't parse the output of different versions of the units program.

Mike Miller <mtmiller>
Project Member
Sat 20 Apr 2013 09:39:23 PM UTC, comment #4:

I've checked 3 versions of the units program and confirmed that they do have different formats that the units function does not handle.

units-1.0 (fetched from http://www.opensource.apple.com/source/misc_cmds/misc_cmds-31/units/):

units-1.88:

units-2.00:

Only versions greater than 1.0 and less than 2.00 currently work with the units function.

Also note that no versions since 1.53 (when units became GNU units) output the full definition of nonlinear unit conversions, so even when the syntax error is fixed the conversion between degC and degK or degF will not be correct.

Mike Miller <mtmiller>
Project Member
Wed 27 Mar 2013 07:43:58 AM UTC, comment #3:

It's strange how we are all getting different results when running this command.

It appears that units.m is running the `units` command. Here is the output of `units "degF" "degK"` on my installation of units:

$ units "degF" "K"
(-> x*0.55555556 +255.37222)
(<- y*1.8 -459.67)

Here is my version of the `units` utility:

$ units -v

units version 1.0 Copyright (c) 1993 by Adrian Mariano
This program may be freely distributed
usage: units [-f unitsfile] [-q] [-v] [from-unit to-unit]

I am running OS X and using the default installation of units.

For the record, the correct conversion from 90 degF to K is 305.372 K.

Vote 539 <vote539>
Sun 24 Mar 2013 12:01:48 PM UTC, comment #2:

On dev octave, misc-1.2.0, and units-2.00-2.fc18.x86_64, I get output:

ctave-cli:2> units("degF", "K", 90)
error: parsing units output "Currency exchange rates from 2012-06-06
* 0.55555556
/ 1.8
"
error: called from:
error: /usr/share/octave/packages/miscellaneous-1.2.0/units.m at line 49, column 20
octave-cli:2>

John Donoghue <lostbard>
Project Member
Wed 06 Feb 2013 02:58:59 PM UTC, comment #1:

Version 1.2.0 of miscellaneous package. Which version are you using? (pkg list)

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Wed 06 Feb 2013 07:24:32 AM UTC, original submission:

Using the units() function available in the Miscellaneous OctaveForge package to convert to Kelvin produces a syntax error.

A code example should illustrate this bug pretty simply:

octave:11> units("degF", "K", 90)
parse error:

syntax error

>>> y = x*0.55555556 +255.37222);
^

parse error:

syntax error

>>> y = x*0.55555556 +255.37222);
^

error: called from:
error: /path/to/octave/miscellaneous-1.2.0/units.m at line 52, column 5

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by vote539 (Posted a comment)
  • -unavailable- added by lostbard (Posted a comment)
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 20 Apr 2013 09:39:23 PM UTCmtmillerStatusWorks For Me=>Confirmed
      SummaryUnits conversion from degC to K has syntax error=>miscellaneous package: units conversion from degC to K fails with units 1.0
    Wed 06 Feb 2013 02:58:59 PM UTCjordighStatusNone=>Works For Me
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup