Bug with adding unit to decimal number

Bug with adding unit to decimal number - Possible Bug in adding units - Messages

#1 Posted: 4/4/2016 4:33:28 PM
DaveN308

DaveN308

0 likes in 2 posts.

Group: User

I tried to do a search and was unable to find a similar problem, so this may be known:

I found a bug when trying to add a unit to a variable with a decimal number.

For example, if I set the variable t:=5 and add the unit (in) by typing (') then selecting (in) and then either TAB or double click the unit, the unit is added as t:=5in.

However, if I set the variable t:=.5 and add the unit as above, when I either hit TAB or double click the unit, the unit is added, but the number is gone: t:=in.

If I type it as t:=5 and add units, such as t:=5in, then later change to .5, it works as normal t:=.5in.

I did not notice this in the past, but I have not had to add units such as this for quite some time, therefore I can't tell you at what revision I saw the problem. I know it exist in the current revision.

If there is a work around, I'd appreciate it.

Dave Nagreski
#2 Posted: 4/4/2016 5:57:14 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

A workaround is using * before ' (you multiply by unit). In correct cases, the program simply adds the multiplication itself for you.
С уважением, Михаил Каганский
1 users liked this post
DaveN308 4/4/2016 6:20:00 PM
#3 Posted: 4/4/2016 6:20:04 PM
DaveN308

DaveN308

0 likes in 2 posts.

Group: User

Wrote

A workaround is using * before ' (you multiply by unit). In correct cases, the program simply adds the multiplication itself for you.



Thanks. That works fine.
#4 Posted: 5/12/2016 3:14:59 AM
johnsonjeven

johnsonjeven

0 likes in 1 posts.

Group: User

Precision is the main difference where double is a double precision (64 bit) floating point data type and decimal is a 128-bit floating point data type.

Double - 64 bit (15-16 digits)
Decimal - 128 bit (28-29 significant digits)

So Decimals have much higher precision and are usually used within monetary (financial) applications that require a high degree of accuracy. But in performance wise Decimals are slower than double and float types. Double Types are probably the most normally used data type for real values, except handling money. More about....Decimal vs Double vs Float

Johnson
#5 Posted: 5/12/2016 10:08:37 AM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Wrote

I tried to do a search and was unable to find a similar problem, so this may be known:

I found a bug when trying to add a unit to a variable with a decimal number.

For example, if I set the variable t:=5 and add the unit (in) by typing (') then selecting (in) and then either TAB or double click the unit, the unit is added as t:=5in.

However, if I set the variable t:=.5 and add the unit as above, when I either hit TAB or double click the unit, the unit is added, but the number is gone: t:=in.

If I type it as t:=5 and add units, such as t:=5in, then later change to .5, it works as normal t:=.5in.

I did not notice this in the past, but I have not had to add units such as this for quite some time, therefore I can't tell you at what revision I saw the problem. I know it exist in the current revision.

If there is a work around, I'd appreciate it.

Dave Nagreski



I believe it is expected that one enters 0.5 (instead of .5) before pressing "'". Not a huge inconvenience in my opinion, and hey you could always use the multiplication workaround if you are choose to omit a zero before decimal point.
#6 Posted: 5/19/2016 7:22:52 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Though it is a bug. And I've just fixed it.
Stay turned for the next nightly build.

Regards.
1 users liked this post
Davide Carpi 5/19/2016 9:09:00 PM
  • New Posts New Posts
  • No New Posts No New Posts