divisors returns empty list for 0

This is mainly for consistency with other words
(factors, group-factors, unique-factors)
db4
Jon Harper 2010-08-08 18:19:15 +02:00 committed by Slava Pestov
parent 653d433798
commit 4fcdb2fbd5
1 changed files with 4 additions and 2 deletions

View File

@ -47,8 +47,10 @@ PRIVATE>
dup 1 = [
1array
] [
group-factors [ first2 [0,b] [ ^ ] with map ] map
[ product ] product-map natural-sort
group-factors dup empty? [
[ first2 [0,b] [ ^ ] with map ] map
[ product ] product-map natural-sort
] unless
] if ;
: unix-factor ( string -- )