Move macros and ensure_approx function.

Allow use of ensure_approx as free function.