math.parser: okay time for sleep, maybe this works, sorry git history.
parent
86639b9df0
commit
f6f596f40f
|
@ -363,7 +363,7 @@ unit-test
|
|||
|
||||
! #1229, float parsing bug, and a regression
|
||||
{ -0.5 } [ "-.5" dec> ] unit-test
|
||||
{ "0" } [ "0" hex> ] unit-test
|
||||
{ 0 } [ "0" hex> ] unit-test
|
||||
|
||||
{ t } [ most-positive-fixnum number>string string>number fixnum? ] unit-test
|
||||
{ t } [ most-negative-fixnum number>string string>number fixnum? ] unit-test
|
||||
|
|
|
@ -288,19 +288,19 @@ DEFER: @neg-digit
|
|||
{ f [ 4drop 0 ] }
|
||||
[ swap call ]
|
||||
} case
|
||||
] curry require-next-digit ; inline
|
||||
] curry next-digit ; inline
|
||||
|
||||
: @neg-first-digit-no-radix ( i number-parse n char -- n/f )
|
||||
{
|
||||
{ CHAR: . [ ->required-mantissa ] }
|
||||
{ CHAR: 0 [ [ @neg-digit ] with-no-radix ] }
|
||||
{ CHAR: 0 [ [ @neg-digit-or-punc ] with-no-radix ] }
|
||||
[ @neg-digit ]
|
||||
} case ; inline
|
||||
|
||||
: @pos-first-digit-no-radix ( i number-parse n char -- n/f )
|
||||
{
|
||||
{ CHAR: . [ ->required-mantissa ] }
|
||||
{ CHAR: 0 [ [ @pos-digit ] with-no-radix ] }
|
||||
{ CHAR: 0 [ [ @pos-digit-or-punc ] with-no-radix ] }
|
||||
[ @pos-digit ]
|
||||
} case ; inline
|
||||
|
||||
|
|
Loading…
Reference in New Issue