Decimal number

Decimal number

johnkelly60
Participant Participant
3,162 Views
6 Replies
Message 1 of 7

Decimal number

johnkelly60
Participant
Participant

It's not that big of a deal, but I just want to know why it's happening...

 

I have my data cell as 0.00 precision decimal number. When I enter a number that's ending in 5 in the 10th decimal place, it rounds up so it'll show up as a number I want. (For example 1.05) However, when I click the cell to edit the number, it shows up as .04999999...1 Why it's happening like this? (Attached is the reference image I'm talking about)

0 Likes
3,163 Views
6 Replies
Replies (6)
Message 2 of 7

illusionistNUGXG
Advocate
Advocate

That is nothing to worry about.

AutoCAD (and basically all vector-based programs) don't use regular numbers.

They work with floating point variables (double float to be precise). These give odd results at about ~12 places after the point. Usually it get rounded to let us see regular numbers.

 

This is also the reason why drawings loose precision, if the content is placed very far away from 0,0,0 coordinates. The odd results get then shifted closer to the point.

0 Likes
Message 3 of 7

Valentin_CAD
Mentor
Mentor

@johnkelly60 ,

 

The highest precision is to 8 decimal places.  Limit your decimal precision no more than 8 decimal.

In your case you may want to display it to two.

 

ValentinWSP_2-1695118000606.png

 

 

ValentinWSP_0-1695117505712.png

 

 

You currently show 14 decimals.

 

ValentinWSP_1-1695117548731.png

 

 

 



Select the "Mark as Solution" if my post solves your issue or answers your question.

Seleccione "Marcar como solución" si mi publicación resuelve o responde a su pregunta.


Emilio Valentin

0 Likes
Message 4 of 7

johnkelly60
Participant
Participant
Thanks for the reply, but I already know this settings. 
Like I said, I have mine set up as 0.00 precision and showing up as the image I included when I want to edit the number.
0 Likes
Message 5 of 7

johnkelly60
Participant
Participant
Yeah I know it's not that big of a deal since it does round up, but I'm just wondering why it does that to only the number ending in 5... it doesn't show up like that when I enter any other number (like 0.02, 0.03, et.)
0 Likes
Message 6 of 7

Valentin_CAD
Mentor
Mentor

@johnkelly60 ,

 

If you typed 45.84999999999999 in the cell, then you will see what you typed when you edit.

 

The 45.85 is just displaying the rounding you specified.

 

If you wanted to see the exact number, then you will have to make the precision as in the cell (with an awareness that it only goes out to 8 decimal places).



Select the "Mark as Solution" if my post solves your issue or answers your question.

Seleccione "Marcar como solución" si mi publicación resuelve o responde a su pregunta.


Emilio Valentin

0 Likes
Message 7 of 7

leeminardi
Mentor
Mentor

As noted, AutoCAD uses a floating point data base of 64 bits for coordinates and table values.  The mantissa is 52 of the bits, the + or - 1 bit, and the exponent 11 bits. This yields about 15 significant digits of precision which is from the fact that 2^52 = 4.5035... x 10^15.

 

It is not correct to say that AutoCAD precision is limited to 8 decimal places.  The display of coordinates is limited to 8 decimal places.  For coordinates of less than 1 the precision could be 15 or more decimal places.  For coordinates of a billion the precision would be less than 6 decimal places (15-9) with the rest of the precision to the left of the decimal point.

 

Just as in a base 10 system 1/3 is an irrational number (0.33333...).  In base 2 (binary) the value of base 10 for 1/10 (0.1) is an irrational number approximately equal to  0.00011001100110011...  an irrational number!  This is why some "nice" numbers in base 10 cannot be cleanly represented in base 2.

lee.minardi