From: anton@mips.complang.tuwien.ac.at   
      
   Krishna Myneni writes:   
   >Nice. However, it's probably not a practical way to do arithmetic of big   
   >numbers, compared to adding binary representations of the number in   
   >larger chunks than single decimal digits. The machine addition   
   >instructions are suited for 32/64 bit additions. Even my approach using   
   >25 decimal digits at a time is slow because of the need to compute the   
   >carry bits for adding to the high 25 digits. Better to have a contiguous   
   >binary representation of the decimal number across the required memory   
   >size needed to hold the sum.   
      
   In the Euler 13 case, each input number is used only once, and as I   
   explained in <2024May3.102927@mips.complang.tuwien.ac.at>, converting   
   an input number to a binary representation costs more than adding it   
   digit-by-digit (i.e., column by column), which my program from that   
   posting does.   
      
   Concerning Ahmed's program, the description sounds like it does the   
   same, but there is the somewhat expensive "10 /mod" in DDA, which is   
   called by the inner loop. Does this program try to perform the   
   addition rowwise rather than columnwise?   
      
   - anton   
   --   
   M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html   
   comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html   
    New standard: https://forth-standard.org/   
    EuroForth 2023: https://euro.theforth.net/2023   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|