merging the Python and JavaScript portions of #2912 Float rounding issues on polyglot/geo/primitives