TITLE: Different arrows in set theory: $\rightarrow$ and $\mapsto$
QUESTION [26 upvotes]: Can someone explain the difference between symbols: 
$\rightarrow$ and $\mapsto$
Thanks.

REPLY [12 votes]: In programming parlance, $\to$ is part of a type signature, while $\mapsto$ is part of a function definition.
The expression
$$x \mapsto \operatorname{floor}(1/x)$$
denotes the function that takes in a number and spits out the floor of its reciprocal.
There are many different type signatures that can be consistently assigned to this function. If you drop in numbers between $0$ and $1$, the function will spit out positive integers, so
$$(0, 1) \to \mathbb{N}$$
is one valid type signature.
As M. Vinay noted, it's not unusual to combine these notations in a function definition. For example, I could declare a function $g$ with the definition and type signature above by writing
$$\begin{align*}
g \colon (0,1) & \to \mathbb{N} \\
x & \mapsto \operatorname{floor}(1/x).
\end{align*}$$