[ [ neg ] [ call ] [ prepend ] tri* "-" prepend text ]
[ [ call ] [ prepend ] bi* text ] if ; inline
+ERROR: unsupported-number-base n base ;
+
M: real pprint*
number-base get {
+ { 10 [ number>string text ] }
{ 16 [ [ >hex ] "0x" pprint-prefixed-number ] }
{ 8 [ [ >oct ] "0o" pprint-prefixed-number ] }
{ 2 [ [ >bin ] "0b" pprint-prefixed-number ] }
- [ drop number>string text ]
+ [ unsupported-number-base ]
} case ;
M: float pprint*
\ NAN: [ fp-nan-payload >hex text ] pprint-prefix
] [
number-base get {
+ { 10 [ number>string text ] }
{ 16 [ [ >hex ] "0x" pprint-prefixed-number ] }
- [ drop number>string text ]
+ [ unsupported-number-base ]
} case
] if ;
classes.union compiler.units continuations definitions effects
eval generic generic.standard hashtables io io.streams.duplex
io.streams.string kernel listener make math namespaces parser
-prettyprint prettyprint.config prettyprint.private
+prettyprint prettyprint.backend prettyprint.config prettyprint.private
prettyprint.sections see sequences splitting
strings tools.continuations tools.continuations.private
tools.test vectors vocabs.parser words ;
{ "0x1000" } [ 16 number-base [ 4096 unparse ] with-variable ] unit-test
{ "1.0" } [ 1.0 unparse ] unit-test
{ "8.0" } [ 8.0 unparse ] unit-test
-{ "8.0" } [ 2 number-base [ 8.0 unparse ] with-variable ] unit-test
-{ "8.0" } [ 8 number-base [ 8.0 unparse ] with-variable ] unit-test
+[ 2 number-base [ 8.0 unparse ] with-variable ] [ unsupported-number-base? ] must-fail-with
+[ 8 number-base [ 8.0 unparse ] with-variable ] [ unsupported-number-base? ] must-fail-with
{ "0x1.0p3" } [ 16 number-base [ 8.0 unparse ] with-variable ] unit-test
{ "1267650600228229401496703205376" } [ 1 100 shift unparse ] unit-test