]> gitweb.factorcode.org Git - factor.git/commitdiff
math.parser: only allow 10 and 16 base for float>base.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 6 Jun 2012 21:50:07 +0000 (14:50 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 6 Jun 2012 21:50:07 +0000 (14:50 -0700)
core/math/parser/parser.factor

index 43abb5a0107d1d89d451b60adee4ead8f0c6c5a4..ffb2293f226143baebf918ef0e12a13d7e8dc15d 100644 (file)
@@ -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>