use NAN and INFINITY macros