math: initial implementation of the general math::truncate_degree() function, including the related type trait.