Bug with adding unit to decimal number

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

#1 Publicado: 4/4/2016 16:33:28
DaveN308

DaveN308

0 me gusta en 2 mensajes.

Grupo: 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 Publicado: 4/4/2016 17:57:14
Mike Kaganski

Mike Kaganski

184 me gusta en 434 mensajes.

Grupo: User

A workaround is using * before ' (you multiply by unit). In correct cases, the program simply adds the multiplication itself for you.
С уважением, Михаил Каганский
A 1 usuarios les gustó este mensaje
DaveN308 4/4/2016 18:20:00
#3 Publicado: 4/4/2016 18:20:04
DaveN308

DaveN308

0 me gusta en 2 mensajes.

Grupo: 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 Publicado: 12/5/2016 3:14:59
johnsonjeven

johnsonjeven

0 me gusta en 1 mensajes.

Grupo: 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 Publicado: 12/5/2016 10:08:37
Alexander O. Melnik

Alexander O. Melnik

127 me gusta en 498 mensajes.

Grupo: 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 Publicado: 19/5/2016 19:22:52
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: Super Administrator

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

Regards.
A 1 usuarios les gustó este mensaje
Davide Carpi 19/5/2016 21:09:00
  • Nuevos mensajes
  • Sin mensajes nuevos