clean up, improve docs.
This commit is contained in:
parent
1050d280f1
commit
751e1cbb73
17
fix16.tal
17
fix16.tal
|
@ -152,15 +152,12 @@
|
|||
( - 00: x = y )
|
||||
( - 01: x > y )
|
||||
@x16-cmp ( x* y* -> c^ )
|
||||
( STH2k x16-is-neg ?&yn ( x* [y*] ; ? ) )
|
||||
STH2k x16-maximum GTH2 ?&yn ( x* [y*] ; ? )
|
||||
( DUP2 x16-is-non-neg ?&same ( x* [y*] ; y>=0 ) )
|
||||
STH2k x16-maximum GTH2 ?&yn ( x* [y*] ; ? )
|
||||
DUP2 x16-minimum LTH2 ?&same ( x* [y*] ; y>=0 )
|
||||
POP2 POP2r #ff JMP2r ( -1 ; x<0 y>=0 )
|
||||
( &yn DUP2 x16-is-neg ?&same ( x* [y*] ; y<0 ) )
|
||||
&yn DUP2 x16-maximum GTH2 ?&same ( x* [y*] ; y<0 )
|
||||
POP2 POP2r #01 JMP2r ( 1 ; x>=0 y<0 )
|
||||
&same STH2r ( fall-thru ) ( res ; x<0 y<0 b )
|
||||
POP2 POP2r #ff JMP2r ( -1 ; x<0 y>=0 )
|
||||
&yn DUP2 x16-maximum GTH2 ?&same ( x* [y*] ; y<0 )
|
||||
POP2 POP2r #01 JMP2r ( 1 ; x>=0 y<0 )
|
||||
&same STH2r ( fall-thru ) ( res ; x<0 y<0 b )
|
||||
|
||||
( unsigned comparison between x and y. )
|
||||
( - ff: x < y )
|
||||
|
@ -262,6 +259,10 @@
|
|||
&rest ADD2 DUP EOR JMP2r
|
||||
|
||||
( use up to 256 iterations of heron's algorithm )
|
||||
( )
|
||||
( NOTE: there are some inaccuracies here, currently )
|
||||
( the algorithm doesn't always converge perfectly. )
|
||||
( it should be "good enough" for many use cases. )
|
||||
@x16-sqrt ( x* -> sqrt[x]* )
|
||||
LIT2r ff00
|
||||
LIT2r 0200 ( [c* 2*] )
|
||||
|
|
Loading…
Reference in New Issue