Unit prefixes [FIXED IN v.1.3.10]

Bugs in ND1 (report'em, get'em fixed)

Unit prefixes [FIXED IN v.1.3.10]

Postby alm » Sat Jul 16, 2011 12:45 pm

Unit prefix support seems spotty. For example, 1,'m,'mm,convert correctly gives 1000 'mm', but 1,'W,'mW,convert results in an unknown unit. kW is defined as a separate unit for some reason. Another strange result is 1,'m,'fm',convert, which returns 1 'fm'. I would expect all SI prefixes to be supported for all SI units, and maybe even the binary ones. The prefixes don't appear to be part of the Units folder, so adding extra doesn't seem trivial.
alm
 
Posts: 12
Joined: Sat Jul 16, 2011 12:26 pm

Re: Unit prefixes

Postby oliver » Sat Jul 16, 2011 4:53 pm

Hi Alm,

Thank you for reporting.

I confirm that prefixes were broken: they would work with SI base units, but not derived units.
I fixed this, and the fix will make it into the next update, which I'm just about to post to Apple. So you should have this in your hands in a few days.

SI prefixes from atto to exa were supported. I extended this list to emcompass the full list from yocto to yotta.
As only prefix, femto was mistakenly capitalized in code (try 'F' in your current version) and, finally, there was a fallback to "1" as scale instead of flagging an error, when a prefix wasn't found. All of this has been corrected.

Sorry, but units didn't get the TLC they deserve. That's in part because I'm planning a complete revamp of the unit system (which is one of the few parts still on the level of the HP-28S): there'll be a Units data type, and you'll be able to enter values with units directly and tap on their badge to choose the applicable conversions, for a far more intuitive user interface.

The list of unit prefixes can be (quite easily) changed/extended. If you're interested in doing that, let me know.
Support of binary multiples requires a few code changes, as the prefixes are two letters of length. So, these have not been added just yet, but I took note of your good suggestion.

Thanks for your detective work!
oliver
Site Admin
 
Posts: 433
Joined: Sat May 01, 2010 2:11 pm

Re: Unit prefixes

Postby alm » Sun Jul 17, 2011 6:07 am

Oliver,

Thanks for your prompt reply! 1 Fm does indeed work instead of 1 fm.

I did notice that units seem a bit primitive compared to say a HP 48, an actual unit type would be a welcome improvement.

Don't see a need to change the prefixes if all SI ones are supported, binary ones are fairly low priority to me since * 1024^(-)n is an acceptable substitute.
alm
 
Posts: 12
Joined: Sat Jul 16, 2011 12:26 pm

Re: Unit prefixes

Postby alm » Sat Jul 23, 2011 6:03 am

Confirmed fixed in 1.3.10.
alm
 
Posts: 12
Joined: Sat Jul 16, 2011 12:26 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron