aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-03-29 18:34:10 -0500
committerJoel Martin <github@martintribe.org>2014-03-29 18:34:10 -0500
commit2e05535fa066c279ea915f8eef7bf775b6bf884a (patch)
tree9bae7085c1b4dbe0d2ce0dde31648a2d576db470
parent0a2c69544bc0684defde8473f9ce2f1991ec9346 (diff)
downloadmal-2e05535fa066c279ea915f8eef7bf775b6bf884a.tar.gz
mal-2e05535fa066c279ea915f8eef7bf775b6bf884a.zip
PS: fix string length calc for printing integers.
-rw-r--r--ps/types.ps4
1 files changed, 2 insertions, 2 deletions
diff --git a/ps/types.ps b/ps/types.ps
index 0cc6372..0e530b5 100644
--- a/ps/types.ps
+++ b/ps/types.ps
@@ -43,7 +43,7 @@
func? { ( } >) }{ (\)) } ifelse
concatenate
}{ /integertype obj type eq { % if number
- /slen obj 10 idiv 1 add def
+ /slen obj 10 add log ceiling cvi def
obj 10 slen string cvrs
}{ /stringtype obj type eq { % if string
print_readably {
@@ -79,7 +79,7 @@ end } def
{ concatenate delim concatenate } forall
dup length delim length sub 0 exch getinterval % strip off final delim
} if
-} def
+end } def
% objA objB -> _equal? -> bool
/_equal? { 6 dict begin