use NaNMath package to return NaNs instead of throwing DomainErrors. Closes #6
Merge pull request #7 from mlubin/nanmath

use NaNMath package to return NaNs instead of throwing DomainErrors