The new Decimal API

This commit is contained in:
Krasimir Angelov
2023-08-21 20:14:26 +02:00
parent 58da8deca8
commit fb398c603e
147 changed files with 918 additions and 188 deletions
+13 -1
View File
@@ -1,4 +1,4 @@
concrete NumeralChi of Numeral = CatChi [Numeral,Digits] ** open ResChi, Prelude in {
concrete NumeralChi of Numeral = CatChi [Numeral,Digits,Decimal] ** open ResChi, Prelude in {
flags coding = utf8 ;
@@ -162,4 +162,16 @@ lin pot4as5 n = n ;
D_8 = ss "8" ;
D_9 = ss "9" ;
PosDecimal d = d ** {hasDot=False} ;
NegDecimal d = {
s = "-" ++ BIND ++ d.s ;
hasDot=False
} ;
IFrac d i = {
s=d.s ++
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
i.s;
hasDot=True
} ;
}