factor/extra/math/unicode/unicode.factor

78 lines
1.5 KiB
Factor
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

! Copyright (C) 2013 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: kernel literals math math.constants math.functions
memoize sequences sequences.extras sets sets.extras ;
IN: math.unicode
CONSTANT: ½ 1/2
CONSTANT: ¼ 1/4
CONSTANT: ¾ 3/4
CONSTANT: 1/3
CONSTANT: 2/3
CONSTANT: 1/5
CONSTANT: 2/5
CONSTANT: 3/5
CONSTANT: 4/5
CONSTANT: 1/6
CONSTANT: 5/6
CONSTANT: 1/8
CONSTANT: 3/8
CONSTANT: 5/8
CONSTANT: 7/8
ALIAS: <=
ALIAS: >=
: ( obj1 obj2 -- ? ) = not ; inline
! Please don't use these
ALIAS: -
ALIAS: ÷ /
ALIAS: /
ALIAS: × *
ALIAS: ^
: ¹ ( m -- n ) ; inline
: ² ( m -- n ) 2 ; inline
: ³ ( m -- n ) 3 ; inline
ALIAS: sqrt
: ( x -- y ) ⅓ ⁿ ; inline
: ( x -- y ) ¼ ⁿ ; inline
ALIAS: ceiling
ALIAS: floor
ALIAS: π pi
MEMO: φ ( -- n ) 5 1 + 2 / ;
CONSTANT: 1/0.
ALIAS: Π product
ALIAS: Σ sum
: ( m -- n ) 1000 / ; inline
: ( m -- n ) 10000 / ; inline
ALIAS: ¬ not
ALIAS: and
ALIAS: or
: ( obj1 obj2 -- ? ) ¬ ; inline
: ( obj1 obj2 -- ? ) ∧ ¬ ; inline
ALIAS: all?
ALIAS: any?
ALIAS: none?
ALIAS: intersect
ALIAS: union
: ( seq elt -- ? ) swap member? ; inline
ALIAS: member?
: ( elt seq -- y ) not ; inline
: ( seq elt -- y ) not ; inline
ALIAS: diff
ALIAS: subset?
ALIAS: superset?
: ( set1 set2 -- ? ) not ; inline
: ( set1 set2 -- ? ) not ; inline