Check if input data is in [T::min(), T::max()] and then cast it to T.
T – Type of returned value and used to specified min, max of valid value range.
if input value not in type range.