add support for nan, +inf, -inf, undefined and documentation