Post Reply 
Is super-accuracy matters?
10-24-2023, 01:33 PM
Post: #32
RE: Is super-accuracy matters?
(10-07-2023 07:24 AM)EdS2 Wrote:  I think this is related: we might ask ourselves, where in the real world might we need unexpectedly great accuracy?



One of the examples often seen is in finance: calculations involving some small rate of interest applied over very many terms ultimately involve transcendental functions and scaled integers. A friend of mine, at the time working in finance, was sorely challenged to reconcile the value of some financial instrument to some precise number of Japanese Yen. Of course, the calculation had to agree with some official way of doing the maths. In the US, at least, I gather that the HP-12C has now become enshrined as the official way to get the one true exactly correct answer. But getting a million dollar sum correct to one cent is still only ten digits or so. Even a trillion dollars of value expressed in yen is just 15 digits. It might be that 30 digits of accuracy will suffice in realistic TVM calculations even in this case.

Which is why Microsoft introduced the "decimal" type:
"The Decimal value type represents decimal numbers ranging from positive 79,228,162,514,264,337,593,543,950,335 to negative 79,228,162,514,264,337,593,543,950,335. The default value of a Decimal is 0. The Decimal value type is appropriate for financial calculations that require large numbers of significant integral and fractional digits and no round-off errors."

"The binary representation of a Decimal value is 128-bits consisting of a 96-bit integer number, and a 32-bit set of flags representing things such as the sign and scaling factor used to specify what portion of it is a decimal fraction. Therefore, the binary representation of a Decimal value the form, ((-296 to 296) / 10(0 to 28)), where -(296-1) is equal to MinValue, and 296-1 is equal to MaxValue. "

https://learn.microsoft.com/en-us/dotnet...ew=net-7.0
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Is super-accuracy matters? - Albert Chan - 10-06-2023, 04:36 PM
RE: Is super-accuracy matters? - Jlouis - 10-06-2023, 04:42 PM
RE: Is super-accuracy matters? - Jlouis - 10-06-2023, 05:05 PM
RE: Is super-accuracy matters? - EdS2 - 10-07-2023, 07:00 AM
RE: Is super-accuracy matters? - EdS2 - 10-07-2023, 07:24 AM
RE: Is super-accuracy matters? - KeithB - 10-24-2023 01:33 PM
RE: Is super-accuracy matters? - vaklaff - 10-24-2023, 03:38 PM
RE: Is super-accuracy matters? - johnb - 10-24-2023, 03:46 PM
RE: Is super-accuracy matters? - johnb - 10-09-2023, 07:12 PM
RE: Is super-accuracy matters? - Johnh - 10-08-2023, 04:37 AM
RE: Is super-accuracy matters? - johnb - 10-09-2023, 07:24 PM
RE: Is super-accuracy matters? - dm319 - 10-13-2023, 03:08 PM
RE: Is super-accuracy matters? - dm319 - 10-10-2023, 07:33 PM
RE: Is super-accuracy matters? - KeithB - 10-13-2023, 03:21 PM
RE: Is super-accuracy matters? - johnb - 10-13-2023, 03:36 PM
RE: Is super-accuracy matters? - johnb - 10-14-2023, 03:38 AM
RE: Is super-accuracy matters? - KeithB - 10-13-2023, 08:57 PM
RE: Is super-accuracy matters? - DA74254 - 10-20-2023, 07:02 AM
RE: Is super-accuracy matters? - mfleming - 10-20-2023, 12:07 PM
RE: Is super-accuracy matters? - EdS2 - 10-20-2023, 08:55 AM
RE: Is super-accuracy matters? - johnb - 10-20-2023, 04:40 PM
RE: Is super-accuracy matters? - Johnh - 10-20-2023, 07:48 PM
RE: Is super-accuracy matters? - dm319 - 10-30-2023, 11:46 AM
RE: Is super-accuracy matters? - EdS2 - 10-20-2023, 09:06 PM
RE: Is super-accuracy matters? - EdS2 - 10-24-2023, 05:20 PM
RE: Is super-accuracy matters? - EdS2 - 11-18-2023, 09:13 AM
RE: Is super-accuracy matters? - klesl - 11-18-2023, 09:24 AM
RE: Is super-accuracy matters? - Johnh - 11-18-2023, 11:11 AM
RE: Is super-accuracy matters? - johnb - 11-20-2023, 11:41 PM
RE: Is super-accuracy matters? - nickapos - 11-18-2023, 05:24 PM
RE: Is super-accuracy matters? - Pekis - 11-19-2023, 08:44 PM
RE: Is super-accuracy matters? - klesl - 11-18-2023, 01:53 PM



User(s) browsing this thread: 2 Guest(s)