hardcode inf and nan rather than string appending