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
|
! #1229, float parsing bug, and a regression
|
||||||
{ -0.5 } [ "-.5" dec> ] unit-test
|
{ -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-positive-fixnum number>string string>number fixnum? ] unit-test
|
||||||
{ t } [ most-negative-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 ] }
|
{ f [ 4drop 0 ] }
|
||||||
[ swap call ]
|
[ swap call ]
|
||||||
} case
|
} case
|
||||||
] curry require-next-digit ; inline
|
] curry next-digit ; inline
|
||||||
|
|
||||||
: @neg-first-digit-no-radix ( i number-parse n char -- n/f )
|
: @neg-first-digit-no-radix ( i number-parse n char -- n/f )
|
||||||
{
|
{
|
||||||
{ CHAR: . [ ->required-mantissa ] }
|
{ CHAR: . [ ->required-mantissa ] }
|
||||||
{ CHAR: 0 [ [ @neg-digit ] with-no-radix ] }
|
{ CHAR: 0 [ [ @neg-digit-or-punc ] with-no-radix ] }
|
||||||
[ @neg-digit ]
|
[ @neg-digit ]
|
||||||
} case ; inline
|
} case ; inline
|
||||||
|
|
||||||
: @pos-first-digit-no-radix ( i number-parse n char -- n/f )
|
: @pos-first-digit-no-radix ( i number-parse n char -- n/f )
|
||||||
{
|
{
|
||||||
{ CHAR: . [ ->required-mantissa ] }
|
{ CHAR: . [ ->required-mantissa ] }
|
||||||
{ CHAR: 0 [ [ @pos-digit ] with-no-radix ] }
|
{ CHAR: 0 [ [ @pos-digit-or-punc ] with-no-radix ] }
|
||||||
[ @pos-digit ]
|
[ @pos-digit ]
|
||||||
} case ; inline
|
} case ; inline
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue