From 9dbeef493374f1841b96b28ff3642860e11c81ee Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 6 Jun 2012 14:50:07 -0700 Subject: [PATCH] math.parser: only allow 10 and 16 base for float>base. --- core/math/parser/parser.factor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index 43abb5a010..ffb2293f22 100644 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -408,7 +408,8 @@ M: ratio >base : float>base ( n base -- str ) { { 16 [ float>hex ] } - [ drop "%.16g" format-float ] + { 10 [ "%.16g" format-float ] } + [ "Invalid base" throw ] } case ; inline PRIVATE>