diff --git a/extra/benchmark/e-decimals/e-decimals.factor b/extra/benchmark/e-decimals/e-decimals.factor index 1328bc20fa..4da5cff828 100644 --- a/extra/benchmark/e-decimals/e-decimals.factor +++ b/extra/benchmark/e-decimals/e-decimals.factor @@ -5,11 +5,11 @@ sequences ; IN: benchmark.e-decimals : D-factorial ( n -- D! ) - iota D: 1 [ 0 D: 1 D+ D* ] reduce ; inline + iota DECIMAL: 1 [ 0 DECIMAL: 1 D+ D* ] reduce ; inline :: calculate-e-decimals ( n -- e ) - n [1,b] D: 1 - [ D-factorial D: 1 swap n D/ D+ ] reduce ; + n [1,b] DECIMAL: 1 + [ D-factorial DECIMAL: 1 swap n D/ D+ ] reduce ; : e-decimals-benchmark ( -- ) 5 [ 800 calculate-e-decimals drop ] times ; diff --git a/extra/decimals/decimals-tests.factor b/extra/decimals/decimals-tests.factor index 726212b0ea..3b09d3b19d 100644 --- a/extra/decimals/decimals-tests.factor +++ b/extra/decimals/decimals-tests.factor @@ -6,7 +6,7 @@ sequences tools.test kernel.private ; IN: decimals.tests { t } [ - D: 12.34 D: 00012.34000 = + DECIMAL: 12.34 DECIMAL: 00012.34000 = ] unit-test : random-test-int ( -- n ) @@ -38,15 +38,15 @@ ERROR: decimal-test-failure D1 D2 quot ; ] unit-test { t } [ - { D: 0. D: .0 D: 0.0 D: 00.00 D: . } all-equal? + { DECIMAL: 0. DECIMAL: .0 DECIMAL: 0.0 DECIMAL: 00.00 DECIMAL: . } all-equal? ] unit-test { t } [ T{ decimal f 90 0 } T{ decimal f 9 1 } = ] unit-test -{ t } [ D: 1 D: 2 before? ] unit-test -{ f } [ D: 2 D: 2 before? ] unit-test -{ f } [ D: 3 D: 2 before? ] unit-test -{ f } [ D: -1 D: -2 before? ] unit-test -{ f } [ D: -2 D: -2 before? ] unit-test -{ t } [ D: -3 D: -2 before? ] unit-test -{ t } [ D: .5 D: 0 D: 1.0 between? ] unit-test +{ t } [ DECIMAL: 1 DECIMAL: 2 before? ] unit-test +{ f } [ DECIMAL: 2 DECIMAL: 2 before? ] unit-test +{ f } [ DECIMAL: 3 DECIMAL: 2 before? ] unit-test +{ f } [ DECIMAL: -1 DECIMAL: -2 before? ] unit-test +{ f } [ DECIMAL: -2 DECIMAL: -2 before? ] unit-test +{ t } [ DECIMAL: -3 DECIMAL: -2 before? ] unit-test +{ t } [ DECIMAL: .5 DECIMAL: 0 DECIMAL: 1.0 between? ] unit-test diff --git a/extra/decimals/decimals.factor b/extra/decimals/decimals.factor index 1d244f0355..05fb11b411 100644 --- a/extra/decimals/decimals.factor +++ b/extra/decimals/decimals.factor @@ -20,7 +20,7 @@ TUPLE: decimal { mantissa read-only } { exponent read-only } ; : parse-decimal ( -- decimal ) scan-token string>decimal ; -SYNTAX: D: parse-decimal suffix! ; +SYNTAX: DECIMAL: parse-decimal suffix! ; : decimal>ratio ( decimal -- ratio ) >decimal< 10^ * ; : decimal>float ( decimal -- ratio ) decimal>ratio >float ;