Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/cmd/4th/lib/dblsharp.4th

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


\ 4tH library - DOUBLE SHARP - Copyright 2009 J.L. Bezemer
\ You can redistribute this file and/or modify it under
\ the terms of the GNU General Public License

[UNDEFINED] num>char [IF]
[UNDEFINED] mu/mod [IF] [NEEDS lib/mixed.4th] [THEN]

128 string dholdbuf
variable hld

: num>char dup 9 > if 7 + then [char] 0 + ;
: dhold 1 hld +! dholdbuf hld @ - c! ;
: <d# 0 hld ! ;
: d#> 2drop hld @ dholdbuf over - swap ;
: dsign rot 0< if [char] - dhold then ;
: d# base @ mu/mod rot num>char dhold ;
: d#s begin d# 2dup or 0= until ;

[DEFINED] 4TH# [IF]
hide hld
hide dholdbuf
[THEN]
[THEN]

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].