]> gitweb.factorcode.org Git - factor.git/blob - extra/math/text/utils/utils.factor
factor: trim using lists
[factor.git] / extra / math / text / utils / utils.factor
1 ! Copyright (c) 2007, 2008 Aaron Schaefer.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math math.functions sequences ;
4 IN: math.text.utils
5
6 : digit-groups ( n k -- seq )
7     [ dup 0 > ] swap '[ _ 10^ /mod ] produce nip ;