Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #135100

Re: Forth for a balanced ternary machine

Date 2026-05-27 00:52 +1000
Subject Re: Forth for a balanced ternary machine
Newsgroups comp.lang.forth
References <10v1h24$1adtp$1@dont-email.me> <2026May25.201036@mips.complang.tuwien.ac.at> <6a153548$1@news.ausics.net> <2026May26.094633@mips.complang.tuwien.ac.at>
From dxf <dxforth@gmail.com>
Message-ID <6a15b394@news.ausics.net> (permalink)
Organization Ausics - https://newsgroups.ausics.net

Show all headers | View raw


On 26/05/2026 5:46 pm, Anton Ertl wrote:
> dxf <dxforth@gmail.com> writes:
>> On 26/05/2026 4:10 am, Anton Ertl wrote:
>>> Gforth since 0.7 implements / and other division words where Forth-94
>>> allows the system to choose as floored division words.  This means
>>> that in Gforth, "2 /" is equivalent to 2/ (which is defined as a shift
>>> right by 1 bit):
>>>
>>> -3 2 / . \ prints -2
>>> -3 2/ .  \ prints -2
>>
>> Which is all very nice until beginners ask how that makes any sense ;-)
> 
> They don't (I know because I have been teaching Forth beginners for
> three decades).  That's because negative dividends are rare, and
> negative divisors are even rarer.  But in those cases where negative
> dividends occur, floored division usually makes sense, and users
> encountering it don't ask.

In a teaching scenario I wouldn't necessarily expect questions either.
Importantly it didn't make sense to forth vendors to make breaking
changes for something that was occasionally useful.

>> ANS at least tells you 2* 2/ are bit-shifters with historic, albeit misleading,
>> names.
> 
> The name of 2* is not misleading on architectures with 2s-complement
> arithmetic.  I.e., every architecture designed in the last
> half-century (the IBM S/360 is actually 62 years old), and everything
> that any existing standard system (for any Forth standard) runs on.

And it's on such machines that one finds symmetric hardware division
co-existing with arithmetic right shift instructions and coders not
getting freaked out by it.

> ...

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Forth for a balanced ternary machine Matthias Koch <m.cook@gmx.net> - 2026-05-25 14:58 +0200
  Re: Forth for a balanced ternary machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-25 18:10 +0000
    Re: Forth for a balanced ternary machine dxf <dxforth@gmail.com> - 2026-05-26 15:53 +1000
      Re: Forth for a balanced ternary machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-26 07:46 +0000
        Re: Forth for a balanced ternary machine dxf <dxforth@gmail.com> - 2026-05-27 00:52 +1000
          Teaching Scenarios [Re: Forth for a balanced ternary machine] Buzz McCool <buzz_mccool@yahoo.com> - 2026-05-26 08:52 -0700
            Re: Teaching Scenarios [Re: Forth for a balanced ternary machine] dxf <dxforth@gmail.com> - 2026-05-28 21:03 +1000
            Re: Teaching Scenarios [Re: Forth for a balanced ternary machine] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-30 20:16 +0000
              Re: Teaching Scenarios [Re: Forth for a balanced ternary machine] minforth <minforth@gmx.net> - 2026-05-31 11:02 +0200
                Re: Teaching Scenarios [Re: Forth for a balanced ternary machine] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-31 14:13 +0000
          Division (was: Forth for a balanced ternary machine) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-30 18:23 +0000
            Re: Division dxf <dxforth@gmail.com> - 2026-05-31 12:49 +1000
              Re: Division anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-31 14:20 +0000
              arithmetic shift right (was: Division) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-31 14:43 +0000
    Re: Forth for a balanced ternary machine Matthias Koch <m.cook@gmx.net> - 2026-05-28 13:36 +0200

csiph-web