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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1d5d5934367929d X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: fixed point vs floating point (When do you use it ?) Date: 1997/11/28 Message-ID: <65nafe$u8@lotho.delphi.com>#1/1 X-Deja-AN: 293479075 Organization: Delphi Internet Services Newsgroups: comp.lang.ada Date: 1997-11-28T00:00:00+00:00 List-Id: In Robert Dewar said: >In practice all stock values will be model numbers of any reasonable >floating-point type, so the issue of accurate representation does not >arise. What is important is the computations that you propose to perform >on these values. I would guess that for most purposes, it is better to >use floating-point for stock prices than fixed-point (of course if you 1) Soon stock prices will be in decimal, and thus not accurately representable by binary floating point types. That's already the case for various commodity prices. 2) For a historical price database, space matters, and fixed point types, depending on the compiler, are in this case easier to store in a substantially smaller number of bytes. (As I recall, there's only one stock price that doesn't fit in 16 bits with a delta, and small, of 1/8, not counting adjusting the historical record for splits etc.) 3) This database was already in this form. 4) Most of the processing of data of this sort is comparisons, multiplication or division by integers, or addition/subtraction. Division of one stock price by another is relatively rare, and thus not timing critical, and multiplication of two stock or commodity prices together is even rarer. So any speed advantage of */ fpt on some new machines is not usually important.