the comparison may cause problem if value is infinit