| Deutsch English Français Italiano |
|
<24bf7eaed4867bc968598dccedcceeb42764d9da@i2pn2.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail From: dxf <dxforth@gmail.com> Newsgroups: comp.lang.forth Subject: Re: Why dial-a-standard is not a thing in Forth Date: Tue, 22 Apr 2025 10:50:13 +1000 Organization: i2pn2 (i2pn.org) Message-ID: <24bf7eaed4867bc968598dccedcceeb42764d9da@i2pn2.org> References: <87bjtn2hct.fsf@gmail.com> <dd55bec1ebb7aab808238c85e4387516@www.novabbs.com> <041d497b574d3140330ec97a2e03690ab2b42b72@i2pn2.org> <nnd$29830c0f$2e51fade@8de92a0923429204> <2025Apr16.232617@mips.complang.tuwien.ac.at> <nnd$60cc02ca$725869db@21cae134d827dee1> <2025Apr18.082817@mips.complang.tuwien.ac.at> <87v7qz5jq1.fsf@nightsong.com> <757e2ced7a6ff4b73d9fa4531d29ff611dc72e10@i2pn2.org> <vu2sk0$3sr9q$1@dont-email.me> <7bacaec09cb8176cf6ae972c04937b0b93732afd@i2pn2.org> <vu5k6a$2da4h$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 22 Apr 2025 00:50:12 -0000 (UTC) Injection-Info: i2pn2.org; logging-data="1340502"; mail-complaints-to="usenet@i2pn2.org"; posting-account="XPw7UV90Iy7EOhY4YuUXhpdoEf5Vz7K+BsxA/Cx8bVc"; User-Agent: Mozilla Thunderbird In-Reply-To: <vu5k6a$2da4h$1@dont-email.me> Content-Language: en-GB X-Spam-Checker-Version: SpamAssassin 4.0.0 Bytes: 2115 Lines: 25 On 22/04/2025 12:19 am, sjack wrote: > dxf <dxforth@gmail.com> 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