I agree that with Fabien that float data-type is inadequate for the arithmetic requirements for unit conversion. In both Python[1] and PostgreSQL[2], the precision of float types are dependent on CPU architecture and Operating System. An Ideal fix would be a data type that is exact to any arbitrary number of digits precision. In Python, the decimal type defaults to 28 digits of precision[3] however has no defined maximum in implementation. In the PostgreSQL manual, the numeric data type is recommended for fields of arbitrary precision. As stated in the documentation[4] "Specifying NUMERIC without any precision or scale creates a column in which numeric values of any precision and scale can be stored, up to the implementation limit on precision.". This datatype, allows for arbitrary precision and and is arithmetically exact, and should be the proper solution for this bug.
I agree that with Fabien that float data-type is inadequate for the arithmetic requirements for unit conversion. In both Python[1] and PostgreSQL[2], the precision of float types are dependent on CPU architecture and Operating System. An Ideal fix would be a data type that is exact to any arbitrary number of digits precision. In Python, the decimal type defaults to 28 digits of precision[3] however has no defined maximum in implementation. In the PostgreSQL manual, the numeric data type is recommended for fields of arbitrary precision. As stated in the documentation[4] "Specifying NUMERIC without any precision or scale creates a column in which numeric values of any precision and scale can be stored, up to the implementation limit on precision.". This datatype, allows for arbitrary precision and and is arithmetically exact, and should be the proper solution for this bug.
[1]http:// docs.python. org/library/ stdtypes. html#numeric- types-int- float-long- complex www.postgresql. org/docs/ 8.1/static/ datatype. html#DATATYPE- FLOAT docs.python. org/library/ decimal. html#module- decimal www.postgresql. org/docs/ 8.1/static/ datatype. html#DATATYPE- NUMERIC- DECIMAL
[2]http://
[3]http://
[4]http://