reimplement Range#size using double with fixing corner cases; ref #2293