Wrong ranges for float/double min/max in ps_intervals
|Reported by:||mase||Owned by:||pcampalani|
|Keywords:||float min max||Cc:||jpass|
I noticed that the minimum and maximum values for float and double in the ps_interval table were:
float: min = max = 162142775926304050882.5588505358010521
double: min = max = 2833951766629323244804321902155471172912937794865349090046421346168433254453061.0659271326051107
Obviously we shouldn't have min = max but also the usual correct values for IEEE 754 float and double are +/- 3.402...E38 for float and +/-1.797...E308 for double.
I found /usr/share/rasdaman/petascope/update8/global_const.sql has the lines:
SELECT cset('FLOAT_MIN', -3.4028234^38::numeric); SELECT cset('FLOAT_MAX', 3.4028234^38::numeric); SELECT cset('DOUBLE_MIN', -1.7976931348623157^308::numeric); SELECT cset('DOUBLE_MAX', 1.7976931348623157^308::numeric);
It seems to be the use of ^ rather than E for the exponent that causes the problem. If I use -3.4028234E38 instead the values come out correctly. I would just change the above lines to use E rather than ^ but I did try setting the values myself manually in my database and, although they appear correct when querying the table ps_interval, when I do a DescribeCoverage on a coverage which is assigned that interval I now get a range of 0 0 appearing in the output so there seems to be some other problem setting the values correctly.
I'm using postgresql v8.4.