From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_20,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,dad65365cb2b3396 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,dad65365cb2b3396 X-Google-Attributes: gidfac41,public X-Google-Thread: 106c43,dad65365cb2b3396 X-Google-Attributes: gid106c43,public X-Google-Thread: 103376,dad65365cb2b3396 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,dad65365cb2b3396 X-Google-Attributes: gid1014db,public From: James Mansion Subject: Re: The disturbing myth of Eiffel portability Date: 1996/11/20 Message-ID: <3292D290.51F7@wgold.demon.co.uk>#1/1 X-Deja-AN: 197691204 x-nntp-posting-host: wgold.demon.co.uk references: <3294e64b.74799475@news2.ibm.net> <56t1m4$nis@bcrkh13.bnr.ca> content-type: text/plain; charset=us-ascii organization: Westongold Ltd mime-version: 1.0 newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.object x-mailer: Mozilla 3.0Gold (WinNT; I) Date: 1996-11-20T00:00:00+00:00 List-Id: Kaz Kylheku wrote: > What fool would use floating point numbers for a banking system in the first > place? Floating point numbers are not well suited for representing currency, > except if their extra mantissa bits allow you to use them as ``large > integers''. Hmm, what fool would make a statement like this without any understanding of derivatives trading? ;-) Seriously, it makes sense to do the risk side of derivatives with doubles. You don't need that last little bit of accuracy when running the valuation models (which are themselves approximations) and you do need them to go fast. The settlements side is a thornier issue and you may need to use large integers, though its not entirely clear cut given the sizes of the principal values concerned. It *is* the case that you have to read the letter of the rounding rules in use very carefully, to see where and how the rounding takes place and to how many decimal places. Bear in mind that while you can't represent all fractions, you *can* represent integers exactly within quite a wide range of values, so you can potentially scale actual values so that the appropriate accuracy is there. James