Version: 5.1.1.5
The mathsymbols library
(require (planet "mathsymbols.rkt" ("stephanh" "mathsymbols.plt" 1 0))) |
This library contains definitions for various Unicode math symbols, such
as ≤, ¬, ∅ and ∈, so that you can use these in your program.
DrRacket has support for typing these symbols by entering a LaTeX-like
sequence such as \leq and then pressing M-\.
1 Numerical operations
(≤ x y ...) → boolean? |
x : real? |
y : real? |
Alias for <=.
In DrRacket, type \leq M-\.
(≥ x y ...) → boolean? |
x : real? |
y : real? |
Alias for >=.
In DrRacket, type \geq M-\.
(≠ x y) → boolean? |
x : number? |
y : number? |
Returns #f if the arguments are numerically equal, #t otherwise.
In DrRacket, type \neq M-\.
(√ x) → number? |
x : number? |
Alias for sqrt.
In DrRacket, type \surd M-\.
2 Famous numbers
Alias for pi, a numerical approximation of
the real π which is, among many other things, the area of the unit circle.
In DrRacket, type \pi M-\.
A number larger than any finite number. Alias for +inf.0.
In DrRacket, type \infty M-\.
A number smaller than any finite number. Alias for -inf.0.
3 Logical operations
(∧ expr ...) → any |
expr : any/c |
Alias for and.
In DrRacket, type \wedge M-\.
(∨ expr ...) → any |
expr : any/c |
Alias for or.
In DrRacket, type \vee M-\.
Fun fact: the symbol looks like a v because "vel" is Latin for "or".
(And Latin is, as we all know, the international language of science.)
(¬ expr) → boolean? |
expr : any/c |
Alias for not.
In DrRacket, type \neg M-\.
(⇒ a b) → any |
a : any/c |
b : any/c |
Implication.
If a evaluates to #f then the whole
form evaluates to #t and b is never evaluated.
Otherwise, it evaluates to whatever b evaluates to.
In DrRacket, type \Rightarrow M-\.
(⇐ a b) → any |
a : any/c |
b : any/c |
Reverse implication.
If a evaluates to a true value then the whole
form evaluates to that value and b is never evaluated.
Otherwise, it evaluates to the logical negation of b.
Note that this is not simply the reversal of ⇒;
the short-cutting works the other way around.
In DrRacket, type \Leftarrow M-\.
(⇔ a b) → boolean? |
a : any/c |
b : any/c |
Double implication.
Returns #t if a and b are the same
considered as truth values, #f otherwise.
Unlike ⇒ and ⇐ this is a plain procedure without any short-cutting behavior.
In DrRacket, type \Leftrightarrow M-\.
4 Function operations
(∘ proc ...) → procedure? |
proc : procedure? |
Alias for compose.
In DrRacket, type \circ M-\.
5 Set operations
(∋ st v) → boolean? |
st : set? |
v : any/c |
Alias for set-member?.
In DrRacket, type \ni M-\.
(∈ v st) → boolean? |
v : any/c |
st : set? |
Like ∋ but with the arguments swapped.
This is the more conventional ordering of arguments.
In DrRacket, type \in M-\.
(∪ st ...+) → set? |
st : set? |
Alias for set-union.
In DrRacket, type \cup M-\.
(∩ st ...+) → set? |
st : set? |
Alias for set-intersect.
In DrRacket, type \cap M-\.
(⊆ st st2) → boolean? |
st : set? |
st2 : set? |
Alias for subset?.
In DrRacket, type \subseteq M-\.
(⊂ st st2) → boolean? |
st : set? |
st2 : set? |
Alias for proper-subset?.
In DrRacket, type \subset M-\.
(⊇ st st2) → boolean? |
st : set? |
st2 : set? |
Like ⊆ but with the arguments swapped.
In DrRacket, type \supseteq M-\.
(⊃ st st2) → boolean? |
st : set? |
st2 : set? |
Like ⊂ but with the arguments swapped.
In DrRacket, type \supset M-\.
6 Famous sets
The empty set. It uses equal? for element comparisons, but
since it doesn’t have any elements to compare with, it actually never
invokes equal?.
In DrRacket, type \emptyset M-\.
The empty set, again. It uses eq? for element comparisons.
The empty set, yet another time. It uses eqv? for element comparisons.
7 Comprehensions
(∀ (for-clause ...) body ...+) |
(∀* (for-clause ...) body ...+) |
Aliases for for/and and for*/and.
In DrRacket, type \forall M-\.
(∃ (for-clause ...) body ...+) |
(∃* (for-clause ...) body ...+) |
Aliases for for/or and for*/or.
In DrRacket, type \exists M-\.
(Σ (for-clause ...) body ...+) |
(Σ* (for-clause ...) body ...+) |
Iterates like for and for*, respectively,
but that the last expression in the bodys must produce a single number.
The result of the expression is the sum of these numbers.
In DrRacket, type \Sigma M-\.
(Π (for-clause ...) body ...+) |
(Π* (for-clause ...) body ...+) |
Iterates like for and for*, respectively,
but that the last expression in the bodys must produce a single number.
The result of the expression is the product of these numbers.
In DrRacket, type \Pi M-\.
(flΣ (for-clause ...) body ...+) |
(flΣ* (for-clause ...) body ...+) |
(flΠ (for-clause ...) body ...+) |
(flΠ* (for-clause ...) body ...+) |
Variants of Σ, Σ*, Π and Π*
which are restricted to flonums.