Bug with adding unit to decimal number

Bug with adding unit to decimal number - Possible Bug in adding units - Сообщения

#1 Опубликовано: 04.04.2016 16:33:28
DaveN308

DaveN308

0 сообщений из 2 понравились пользователям.

Группа: 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 Опубликовано: 04.04.2016 17:57:14
Mike Kaganski

Mike Kaganski

184 сообщений из 434 понравились пользователям.

Группа: User

A workaround is using * before ' (you multiply by unit). In correct cases, the program simply adds the multiplication itself for you.
С уважением, Михаил Каганский
1 пользователям понравился этот пост
DaveN308 04.04.2016 18:20:00
#3 Опубликовано: 04.04.2016 18:20:04
DaveN308

DaveN308

0 сообщений из 2 понравились пользователям.

Группа: 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 Опубликовано: 12.05.2016 03:14:59
johnsonjeven

johnsonjeven

0 сообщений из 1 понравились пользователям.

Группа: 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 Опубликовано: 12.05.2016 10:08:37
Alexander O. Melnik

Alexander O. Melnik

127 сообщений из 494 понравились пользователям.

Группа: 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 Опубликовано: 19.05.2016 19:22:52
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

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

Regards.
1 пользователям понравился этот пост
Davide Carpi 19.05.2016 21:09:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений