add NaN test

@kiyoshiiriemon please review and merge my code