Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
$\begingroup$0.833'20 gives what you expect, but SetPrecision[a,20] is equivalent to N[FromDigits[RealDigits[a,2],2],20] = 0.83299999999999996270. MMA works with binary numbers.$\endgroup$
$\begingroup$The back tick is used in specifying numeric input. Using it on variables thus a`20 is not syntactically valid. The problem is that a = 0.833 evaluates 0.833 in machine precision binary and obtains the binary floating point number nearest to 0.833, but that number is only approximately equal to 0.833.$\endgroup$
$\begingroup$You don't need a'20. Just use a=0.833'20 and a will have 20 digits of precision from then on or until it is reassigned. That is supposed to be a back tick, but I can't write it that way because of the way comments treat back ticks.$\endgroup$
SetPrecision[a,20]is equivalent toN[FromDigits[RealDigits[a,2],2],20] = 0.83299999999999996270. MMA works with binary numbers. $\endgroup$a`20is not syntactically valid. The problem is thata = 0.833evaluates0.833in machine precision binary and obtains the binary floating point number nearest to0.833, but that number is only approximately equal to0.833. $\endgroup$a'20. Just usea=0.833'20andawill have 20 digits of precision from then on or until it is reassigned. That is supposed to be a back tick, but I can't write it that way because of the way comments treat back ticks. $\endgroup$