math.parser: number>string, don't throw zero division on '1/0'

locals-and-roots
Jon Harper 2015-06-15 18:13:41 +02:00 committed by John Benediktsson
parent cf0f748991
commit 0b98eb121e
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ TUPLE: number-parse
digit> pick radix>> over > ; inline
: ?make-ratio ( num denom/f -- ratio/f )
[ / ] [ drop f ] if* ; inline
! don't use number= to allow 0. for "1/0."
[ dup 0 = [ 2drop f ] [ / ] if ] [ drop f ] if* ; inline
TUPLE: float-parse
{ radix fixnum }