factor/library/syntax/math.factor

20 lines
483 B
Factor
Raw Normal View History

2005-05-03 04:40:13 -04:00
! Copyright (C) 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
IN: !syntax
2005-07-30 02:08:59 -04:00
USING: kernel lists math parser sequences syntax vectors ;
2005-05-03 04:40:13 -04:00
! Complex numbers
: #{ f ; parsing
2005-07-30 02:08:59 -04:00
: }# dup first swap second rect> swons ; parsing
2005-05-03 04:40:13 -04:00
! Reading integers in other bases
: (BASE) ( base -- )
#! Reads an integer in a specific base.
scan swap base> swons ;
: HEX: 16 (BASE) ; parsing
: DEC: 10 (BASE) ; parsing
: OCT: 8 (BASE) ; parsing
: BIN: 2 (BASE) ; parsing