0

When I select I get the following value: 1.79769313486232E+308

The Column type is float.

When I'm trying to insert this value to the same table and column, I'm getting the following error:

The floating point value '1.79769313486232E+308' is out of the range of computer representation (8 byte)

When I select with master.dbo.fn_varbintohexstr(ColumnName) I'm getting the hex value as 0x7fefffffffffffff which is less then 8 bytes...

Any explanation please?

SHR
  • 7,940
  • 9
  • 38
  • 57
  • Probably rounding - expotential representation has limited digits. `SELECT max_float = (1 + (POWER(2e0, 52) - 1) / POWER(2e0, 52)) * POWER(2e0, 1023)` [DB<>FIDDLE demo](https://dbfiddle.uk/?rdbms=sqlserver_2017&fiddle=950e1888c7930783f5590ab81872943f) – Lukasz Szozda Mar 10 '19 at 16:19
  • [Getting maximum value of float in SQL programmatically](https://stackoverflow.com/a/38020122/5070879) – Lukasz Szozda Mar 10 '19 at 16:24
  • the hex value is `0x7fefffffffffffff` which is less then 8 bytes... – SHR Mar 10 '19 at 16:31
  • I made program to copy/backup several tables using SQL script, I can get the value but I fail to restore it. – SHR Mar 11 '19 at 15:49

0 Answers0