home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 116,605 of 117,927   
   Gerry Jackson to Krishna Myneni   
   Re: exercise in double number arithmetic   
   07 Jul 24 15:33:37   
   
   From: do-not-use@swldwa.uk   
      
   On 07/07/2024 14:17, Krishna Myneni wrote:   
   > On 7/7/24 00:48, Ahmed wrote:   
   >> On Sat, 6 Jul 2024 23:50:28 (UTC), Krishna Myneni wrote:   
   >>   
   >>> On 7/6/24 16:59, Ahmed wrote:   
   >> ...   
   >>> : solution ( -- d)   
   >>>      1 s>d 43 22 do i 1 m*/ loop d>f   
   >>>      21 dup s>d rot 2 do I 1 m*/ loop d>f   
   >>>      f/ fround f>d ;   
   >>>   
   >> ...   
   >>> Krishna   
   >>   
   >>   
   >> You have not to use fround. (42!/21!) is an integer and is multiple of   
   >> 21!.   
   >> in other words 42! is multiple of (21!)^2.   
   >>   
   >   
   > The FROUND is necessary because 42!/21! is too large of an integer to be   
   > exactly represented by double-precision fp (IEEE format) and F>D is a   
   > truncating operation, not rounding.   
   >   
   > The whole D>F and floating point operations can be dispensed with if we   
   > have D/MOD -- a double length version /MOD.   
   >   
   > --   
   > Krishna   
   >   
   >   
      
   There is a +D/MOD in this link   
      
   http://www3.cs.stonybrook.edu/~algorith/implement/random-number/   
   istrib/r250.seq   
      
   --   
   Gerry   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca