Type checking for numbers in numerical operations