Rounding error of floating-point arithmetic (rounding error)

When reading the rhino book, I suddenly found an interesting place to record: I
Insert picture description here
went to the browser and tried it and it turned out to be like this:
Insert picture description here
I tried c# again, which is also the case.
Insert picture description here
But there is a decimal data type in c#, and there is no loss of accuracy
Insert picture description here
this morning. I checked csdn, and I accidentally saw a similar article. Come over and see if the one I wrote before is correct. By the way, I will post the solution ideas of the boss, the original portal
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41885871/article/details/103597823