According to MSDN, the range of REAL values is 3.40E + 38 to -1.18E - 38, 0 and 1.18E - from 38 to 3.40E + 38. However, I have quite a few values outside this range in my table.
The following query returns many very small values and not very large:
SELECT MyColumn ,
*
FROM data.MyTable
WHERE MyColumn <> 0
AND ( MyColumn < CONVERT(REAL, 1.18E-38)
OR MyColumn > CONVERT(REAL, 3.40E+38)
)
AND ( MyColumn < CONVERT(REAL, -3.40E+38)
OR MyColumn > CONVERT(REAL, -1.18E-38)
)
It is easy to show how these values get into the table. I cannot insert them directly:
CREATE TABLE a(r REAL NULL);
GO
INSERT INTO a(r) VALUES(4.330473E-39);
GO
SELECT r FROM a
GO
DROP TABLE a;
0.0
But I can separate the two columns and get and outside the range value:
CREATE TABLE a
(
r1 REAL NULL ,
r2 REAL NULL ,
r3 REAL NULL
) ;
GO
INSERT INTO a
( r1, r2 )
VALUES ( 4.330473E-38, 1000 ) ;
GO
UPDATE a
SET r3 = r1 / r2 ;
SELECT r1 ,
r2 ,
r3
FROM a
r1 r2 r3
4.330473E-38 1000 4.330433E-41
So, I assume that MSDN is giving incorrect ranges of valid data, right? Did I miss something?
Several people have suggested that this is a mistake.
What part of this behavior is exactly a mistake. this: