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 117,234 of 117,927    |
|    dxf to sjack    |
|    Re: Why dial-a-standard is not a thing i    |
|    22 Apr 25 10:50:13    |
   
   From: dxforth@gmail.com   
      
   On 22/04/2025 12:19 am, sjack wrote:   
   > dxf wrote:   
   >>   
   >> Out of curiosity what was the conversion method?   
   >>   
   > -- CVD ( n_x -- n_decimal)   
   > -- Convert to decimal   
   > -- Split given 3 digit number into digits and   
   > -- reassemble digits into a decimal number.   
   >   
   > Base is used to get the digits but regardless of the base each digit   
   > is treated as a decimal value, what the user had intended, and assembled   
   > into a decimal number.   
      
   Thanks. So something like this ...   
      
   : CVD ( n1 -- n2 ) \ convert to decimal   
    3 0 do base @ /mod loop   
    3 0 do #10 * swap + loop ;   
      
   16 base ! 10 cvd decimal . 10 ok   
   2 base ! 10 cvd decimal . 10 ok   
   36 base ! -10 cvd decimal . -10 ok   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca