COMP.ARCH---------------- < Пред. | След. > -- < @ > -- < Сообщ. > -- < Эхи > --
 Nп/п : 78 из 100
 От   : Anton Ertl                          2:5075/128        30 сен 23 07:05:15
 К    : John Levine                                           30 сен 23 10:22:03
 Тема : Re: decimal arithmetic, data sizes, Solving the Floating-Point Conundru
----------------------------------------------------------------------------------
                                                                                 
@MSGID: <2023Sep30.090515@mips.complang.tuwien.ac.at>
42fa7d12
@REPLY: 1@gal.iecc.com> a8500907
@REPLYADDR Anton Ertl
<anton@mips.complang.tuwien.ac.at>
@REPLYTO 2:5075/128 Anton Ertl
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID:
<2023Sep30.090515@mips.complang.tuwien.ac.at>
@RFC-References:
<57c5e077-ac71-486c-8afa-edd6802cf6b1n@googlegroups.com> <2023Sep23.123024@mips.complang.tuwien.ac.at> 2@gal.iecc.com>
<2023Sep29.102825@mips.complang.tuwien.ac.at> 1@gal.iecc.com>
@TZUTC: 0000
@TID: FIDOGATE-5.12-ge4e8b94
John Levine <johnl@taugh.com> writes:
>According to Anton Ertl <anton@mips.complang.tuwien.ac.at>:
>>But I can see how a sleek salesman can convince a gullible (or
>>corrupt) member of upper management that they absolutely need to have
>>decimal FP in their hardware for the correctness of their financial
>>calculations. ...
>
>DFP is not like binary FP. Every value has a "quantum", the scale of
>its least significant digit, arithmetic operations maintain the
>quantum rather than fully normalizing, and at least on zSeries there`s
>a whole bunch of options to control rounding and to trap if result
>can`t be represented with the intended quantum. It does not do what
>BFP does, normalize every time to keep as many bits as possible.

Yes.  So it`s better adapted to the fixed-point procedures of
financial computing.  But it`s still unnecessary.

>You can certainly implement anything in scaled fixed binary (that`s
>why Von Neumann didn`t want FP hardware on his machines) but for
>financial calculations where the decimal rounding really matters, I
>can see why DFP would make it easier to get right.

I don`t.  For scientific computing normalizing FP makes programming so
much easier (and, with FP hardware, the result faster) that even in
the 1950s, before the software crisis became a thing (and it has still
not really become a thing in supercomputing up to now), FP won over
fixed point.  Von Neumann was wrong in this.

But for financial computing, where the procedures require fixed point,
there is no reason for floating-point.  As mentioned Burroughs DFP was
not successful, and as far as I can tell, neither Intel nor IBM DFP
are (except maybe as marketing instrument for IBM salesmen); nobody
uses it.

Concerning rounding, if the number is represented in binary, you just
need to divide it by 10^p (one multiplication), compute the remainder
(another multiplication and a subtraction), and then compare the
remainder to 0.5*10^p (maybe also considering the lowest bit of the
quotient).  Pretty cheap, probably cheaper than using IBMs DFP
operations.

- anton
-- 
`Anyone trying for "industrial quality" ISA should avoid undefined behavior.`
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
--- xrn 10.11
 * Origin: Institut fuer Computersprachen, Technische Universitaet (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх