Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

You're at Witt's End.


devel / comp.lang.forth / Re: Selling lot of Forth books on ebay

SubjectAuthor
* Selling lot of Forth books on ebayJeff Bernstein
`* Re: Selling lot of Forth books on ebayZbig
 +- Re: Selling lot of Forth books on ebayJurgen Pitaske
 `* Re: Selling lot of Forth books on ebaydxforth
  +* Re: Selling lot of Forth books on ebayJeff Bernstein
  |`- Re: Selling lot of Forth books on ebaydxforth
  +* Re: Selling lot of Forth books on ebayJurgen Pitaske
  |`* Re: Selling lot of Forth books on ebaydxforth
  | `- Re: Selling lot of Forth books on ebayJurgen Pitaske
  +* Re: Selling lot of Forth books on ebayZbig
  |`- Re: Selling lot of Forth books on ebaydxforth
  `* Re: Selling lot of Forth books on ebayZbig
   `* Re: Selling lot of Forth books on ebaydxforth
    `* Re: Selling lot of Forth books on ebayZbig
     `* Re: Selling lot of Forth books on ebaydxforth
      `* Re: Selling lot of Forth books on ebayZbig
       `* Re: Selling lot of Forth books on ebaydxforth
        +* Re: Selling lot of Forth books on ebayZbig
        |`* Re: Selling lot of Forth books on ebaydxforth
        | `- Re: Selling lot of Forth books on ebayZbig
        `* Re: Selling lot of Forth books on ebaynone
         +* Re: Selling lot of Forth books on ebaydxforth
         |`- Re: Selling lot of Forth books on ebayHeinrich Hohl
         `* Re: Selling lot of Forth books on ebayAnton Ertl
          `* Re: Selling lot of Forth books on ebaynone
           +* Re: Selling lot of Forth books on ebayMarcel Hendrix
           |`* Re: Selling lot of Forth books on ebaynone
           | `- Re: Selling lot of Forth books on ebayMarcel Hendrix
           `- Re: Selling lot of Forth books on ebaydxforth

Pages:12
Re: Selling lot of Forth books on ebay

<ff24b509-a29d-4a5c-8782-a7544b6ec680n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19741&group=comp.lang.forth#19741

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:2889:b0:6b6:5410:b2c7 with SMTP id j9-20020a05620a288900b006b65410b2c7mr19222094qkp.697.1660756205968;
Wed, 17 Aug 2022 10:10:05 -0700 (PDT)
X-Received: by 2002:ad4:5964:0:b0:479:5465:9a87 with SMTP id
eq4-20020ad45964000000b0047954659a87mr23258408qvb.90.1660756205782; Wed, 17
Aug 2022 10:10:05 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 17 Aug 2022 10:10:05 -0700 (PDT)
In-Reply-To: <nnd$1aaabc61$5a5da541@51339da42f2a016c>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:8886:e67:72f1:efb9;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:8886:e67:72f1:efb9
References: <8b6650ae-a532-4682-9f59-10028b2e085cn@googlegroups.com>
<td7ca9$1m7i$1@gioia.aioe.org> <nnd$3a359142$086ac3f9@73123d2fec620740>
<2022Aug17.112518@mips.complang.tuwien.ac.at> <nnd$1aaabc61$5a5da541@51339da42f2a016c>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ff24b509-a29d-4a5c-8782-a7544b6ec680n@googlegroups.com>
Subject: Re: Selling lot of Forth books on ebay
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Wed, 17 Aug 2022 17:10:05 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2606
 by: Marcel Hendrix - Wed, 17 Aug 2022 17:10 UTC

On Wednesday, August 17, 2022 at 5:57:55 PM UTC+2, none albert wrote:
> In article <2022Aug1...@mips.complang.tuwien.ac.at>,
> Anton Ertl <an...@mips.complang.tuwien.ac.at> wrote:
[..]
> >>UM* and M/MOD are the exceptions handling unsigned numbers.
> >>These are necessary (in 16 bits forths) to print numbers of more than 16 bits.
> >
> >Why would one need UM* for printing numbers?
> Nit picking. Number I/O.
> >Why did you bring up M/MOD?
> It is a remnant of 80' figForth (polyforth?) that possibly
> lingers somewhere.

The only 'problematic' division word that I remember is " M/ " ...

D:\dfwforth\examples\benchmar\MPEBench\benchm.frt(163): : M/ \ d n1 -- quot
D:\dfwforth\examples\benchmar\MPEBench\benchm.frt(318): : $M/$ .ann ." M/" [$ /prims DUP 1+ 1 DO 1000 0 I M/ [o/n] DROP LOOP $] ;
D:\dfwforth\examples\gnuplot\pspice.frt(61): ehandle FILE-SIZE ?FILE 1 DFLOATS M/ 2- #items 2+ / ( needed array size ) LOCAL recs
D:\dfwforth\examples\misc\assycall.frt(97): n #25 * M/ DEC. ." clockticks per character" ;
D:\dfwforth\examples\misc\egcd.frt(46): OVER S>D 2 PICK m M* D- n M/ ;

( egcd is Knuth's Algorithm E, TAOCP, Fundamental Algorithms, page 15.
Extended Euclid's Algorithm; d = gcd(m,n) = a*m + b*n )

-marcel

Re: Selling lot of Forth books on ebay

<tdkop3$rfo$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19743&group=comp.lang.forth#19743

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Selling lot of Forth books on ebay
Date: Thu, 18 Aug 2022 17:12:35 +1000
Organization: Aioe.org NNTP Server
Message-ID: <tdkop3$rfo$1@gioia.aioe.org>
References: <8b6650ae-a532-4682-9f59-10028b2e085cn@googlegroups.com>
<td7ca9$1m7i$1@gioia.aioe.org> <nnd$3a359142$086ac3f9@73123d2fec620740>
<2022Aug17.112518@mips.complang.tuwien.ac.at>
<nnd$1aaabc61$5a5da541@51339da42f2a016c>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="28152"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.1.2
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 18 Aug 2022 07:12 UTC

On 18/08/2022 01:57, albert wrote:
> In article <2022Aug17.112518@mips.complang.tuwien.ac.at>,
> Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>> albert@cherry.(none) (albert) writes:
>>> There is no modern language (python, go) that uses symmetric.
>>
>> <https://en.wikipedia.org/wiki/Modulo_operation#In_programming_languages>
>> has 97 occurences of "truncated" (symmetric). Looking for languages
>> that are younger (more modern?) than Python, ActionScript, C#,
>> Clopjure, CoffeeScript, D, Dart and many others support symmetric
>> remainder; some of them support symmetric in addition to floored
>> (e.g., CoffeeScript) or Euclidean (Dart).
>
> Supporting is something different. We have SM/REM.
>
> Integer division has finally won over, and Python users
> are free from worrying over FM/MOD and SM/REM.

Not according to these.

https://stackoverflow.com/questions/3883004/the-modulo-operation-on-negative-numbers-in-python
https://stackoverflow.com/questions/48170942/modulus-of-negative-number
https://stackoverflow.com/questions/65207679/modulo-operation-with-negative-numbers-in-python

Re: Selling lot of Forth books on ebay

<nnd$4a23fc75$79695431@21510a93050f5ee1>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19745&group=comp.lang.forth#19745

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
Subject: Re: Selling lot of Forth books on ebay
References: <8b6650ae-a532-4682-9f59-10028b2e085cn@googlegroups.com> <2022Aug17.112518@mips.complang.tuwien.ac.at> <nnd$1aaabc61$5a5da541@51339da42f2a016c> <ff24b509-a29d-4a5c-8782-a7544b6ec680n@googlegroups.com>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$4a23fc75$79695431@21510a93050f5ee1>
Organization: KPN B.V.
Date: Thu, 18 Aug 2022 12:56:40 +0200
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 25
Injection-Date: Thu, 18 Aug 2022 12:56:40 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1639
 by: none - Thu, 18 Aug 2022 10:56 UTC

In article <ff24b509-a29d-4a5c-8782-a7544b6ec680n@googlegroups.com>,
Marcel Hendrix <mhx@iae.nl> wrote:
<SNIP>
>
>( egcd is Knuth's Algorithm E, TAOCP, Fundamental Algorithms, page 15.
> Extended Euclid's Algorithm; d = gcd(m,n) = a*m + b*n )

\ For A B return C GCD where C*A+x*B=GCD
: XGCD 1 0 2SWAP BEGIN OVER /MOD OVER WHILE >R SWAP
2SWAP OVER R> * - SWAP 2SWAP REPEAT 2DROP NIP ;

C --> m , x --> n
You can can find x from the result of XGCD if you want.

I remember that Elizabeth Rather was upset over this implementation.

>
>-marcel
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Selling lot of Forth books on ebay

<19465732-73fc-4286-ab63-2d5989bc89dfn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19748&group=comp.lang.forth#19748

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:28cf:b0:6b5:e32f:febb with SMTP id l15-20020a05620a28cf00b006b5e32ffebbmr1727940qkp.258.1660824374315;
Thu, 18 Aug 2022 05:06:14 -0700 (PDT)
X-Received: by 2002:a05:620a:e89:b0:6ba:a3d2:fb82 with SMTP id
w9-20020a05620a0e8900b006baa3d2fb82mr1733260qkm.233.1660824374121; Thu, 18
Aug 2022 05:06:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 18 Aug 2022 05:06:13 -0700 (PDT)
In-Reply-To: <nnd$4a23fc75$79695431@21510a93050f5ee1>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:8886:e67:72f1:efb9;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:8886:e67:72f1:efb9
References: <8b6650ae-a532-4682-9f59-10028b2e085cn@googlegroups.com>
<2022Aug17.112518@mips.complang.tuwien.ac.at> <nnd$1aaabc61$5a5da541@51339da42f2a016c>
<ff24b509-a29d-4a5c-8782-a7544b6ec680n@googlegroups.com> <nnd$4a23fc75$79695431@21510a93050f5ee1>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <19465732-73fc-4286-ab63-2d5989bc89dfn@googlegroups.com>
Subject: Re: Selling lot of Forth books on ebay
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Thu, 18 Aug 2022 12:06:14 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 6057
 by: Marcel Hendrix - Thu, 18 Aug 2022 12:06 UTC

On Thursday, August 18, 2022 at 12:56:44 PM UTC+2, none albert wrote:
> In article <ff24b509-a29d-4a5c...@googlegroups.com>,
> Marcel Hendrix <m...@iae.nl> wrote:
> <SNIP>
> >
> >( egcd is Knuth's Algorithm E, TAOCP, Fundamental Algorithms, page 15.
> > Extended Euclid's Algorithm; d = gcd(m,n) = a*m + b*n )
> \ For A B return C GCD where C*A+x*B=GCD
> : XGCD 1 0 2SWAP BEGIN OVER /MOD OVER WHILE >R SWAP
> 2SWAP OVER R> * - SWAP 2SWAP REPEAT 2DROP NIP ;
>
> C --> m , x --> n
> You can can find x from the result of XGCD if you want.
>
> I remember that Elizabeth Rather was upset over this implementation.
[..]

I guess she preferred
: xgcd2 ( a b -- gcd x y) \ gcd = x*a + y*b
DUP 0= IF 1 SWAP EXIT ENDIF
TUCK /MOD >R RECURSE TUCK R> * - ;

-marcel

( Remarkable how quickly hardware changes. Since 2014
CPUs got 100x faster and made algorithms switch places. )

ANEW -egcd ( created Tuesday 2 June, 2014 )

-- Knuth's Algorithm E, TAOCP, Fundamental Algorithms, page 15.
-- Extended Euclid's Algorithm; d = gcd(m,n) = a*m + b*n
: xgcd1 ( m n -- d a b )
0 1 1 0 0 LOCALS| q a a' b b' d c |
BEGIN c d /MOD ( -- r q ) OVER
WHILE d TO c TO q TO d
a' a TO a' a q * - TO a
b' b TO b' b q * - TO b
REPEAT 2DROP
d a b ;

: xgcd2 ( a b -- gcd x y) \ gcd = x*a + y*b
DUP 0= IF 1 SWAP EXIT ENDIF
TUCK /MOD >R RECURSE TUCK R> * - ;

: xgcd2b ( a b -- gcd x y) \ gcd = x*a + y*b
DUP 0= ( a b flag)
IF 1 SWAP ( -- a 1 0)
ELSE TUCK ( b a b)
/MOD ( b a mod b [a/b] )
>R ( b a mod b )
RECURSE ( gcd' x' y')
TUCK R> ( gcd' y' x' y' [a/b])
* - ( -- gcd x y)
THEN ;

: xgcd3 ( m n -- d a b )
SWAP 0 1 0 LOCALS| q a' b' c |
>R 0 1 ( -- a b )
BEGIN c R@ /MOD ( -- a b r q ) OVER
WHILE TO q R> TO c >R ( -- a b )
SWAP a' SWAP DUP TO a' q * -
SWAP b' SWAP DUP TO b' q * -
REPEAT 2DROP R> -ROT ;

: xgcd4 ( m n -- d a b )
SWAP DUP 1 0 LOCALS| q a' c m n |
n >R 0 ( -- a )
BEGIN c R@ /MOD ( -- a r q ) OVER
WHILE TO q R> TO c >R ( -- a )
a' SWAP DUP TO a' q * -
REPEAT 2DROP R> SWAP ( -- gcd a )
OVER S>D 2 PICK m M* D- n M/ ;

0 VALUE #tested
0 VALUE num1
0 VALUE num2

: SAME? ( a b -- )
2DUP 2>R xgcd2 >S
2R> xgcd4 >S
D<> S> S> <>
OR IF CR ." error: " num1 . num2 . ." test differently."
TRUE ABORT" xgcd2 and xgcd4 not equal"
ENDIF ;

: OK? CLEAR #tested
BEGIN
RANDOM DUP TO num1 RANDOM DUP TO num2
SAME?
1 +TO #tested
#tested $3FF AND
0= IF EKEY? ELSE FALSE ENDIF
UNTIL
CR #tested DEC. ." numbers tested." ;

: 1? #30000000 0 DO RANDOM RANDOM xgcd1 3DROP LOOP ;
: 2? #30000000 0 DO RANDOM RANDOM xgcd2 3DROP LOOP ;
: 2b? #30000000 0 DO RANDOM RANDOM xgcd2b 3DROP LOOP ;
: 3? #30000000 0 DO RANDOM RANDOM xgcd3 3DROP LOOP ;
: 4? #30000000 0 DO RANDOM RANDOM xgcd4 3DROP LOOP ;
: 11? #30000000 0 DO #2659539033 #2086106244 xgcd1 3DROP LOOP ;
: 22? #30000000 0 DO #2659539033 #2086106244 xgcd2 3DROP LOOP ;
: 22b? #30000000 0 DO #2659539033 #2086106244 xgcd2b 3DROP LOOP ;
: 33? #30000000 0 DO #2659539033 #2086106244 xgcd3 3DROP LOOP ;
: 44? #30000000 0 DO #2659539033 #2086106244 xgcd4 3DROP LOOP ;

: SPEED? ( -- )
1 TO seed CR ." xgcd1 : " TIMER-RESET 1? .ELAPSED
1 TO seed CR ." xgcd1 : " TIMER-RESET 11? .ELAPSED
1 TO seed CR ." xgcd2 : " TIMER-RESET 2? .ELAPSED
1 TO seed CR ." xgcd2 : " TIMER-RESET 22? .ELAPSED
1 TO seed CR ." xgcd2b: " TIMER-RESET 22b? .ELAPSED
1 TO seed CR ." xgcd2b: " TIMER-RESET 2b? .ELAPSED
1 TO seed CR ." xgcd3 : " TIMER-RESET 3? .ELAPSED
1 TO seed CR ." xgcd3 : " TIMER-RESET 33? .ELAPSED
1 TO seed CR ." xgcd4 : " TIMER-RESET 4? .ELAPSED
1 TO seed CR ." xgcd4 : " TIMER-RESET 44? .ELAPSED ;

DOC
(*
\ in 2014, #300,000 times
FORTH> speed?
xgcd1: 3.217 seconds elapsed.
xgcd1: 5.763 seconds elapsed.
xgcd2: 2.971 seconds elapsed.
xgcd2: 5.281 seconds elapsed.
....
....
xgcd3: 3.166 seconds elapsed.
xgcd3: 5.684 seconds elapsed.
xgcd4: 2.908 seconds elapsed.
xgcd4: 5.042 seconds elapsed. ok

\ 2022, AMD Ryzen 7 5800X, #30,000,000 instead of #300,000 times
FORTH> speed?
xgcd1 : 2.747 seconds elapsed.
xgcd1 : 0.937 seconds elapsed.
xgcd2 : 3.875 seconds elapsed.
xgcd2b: 1.247 seconds elapsed.
xgcd2b: 3.887 seconds elapsed.
xgcd2 : 1.311 seconds elapsed.
xgcd3 : 3.641 seconds elapsed.
xgcd3 : 1.252 seconds elapsed.
xgcd4 : 2.648 seconds elapsed.
xgcd4 : 0.927 seconds elapsed.
*)
ENDDOC


devel / comp.lang.forth / Re: Selling lot of Forth books on ebay

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor