...
a domain error occurs if an input argument is outside the domain over which the mathematical function is defined.
a range error occurs if the mathematical result of the function cannot be represented in an object of the specified type, due to extreme magnitude.
...