NaN - not a Number

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ralle1
Posts: 43
Joined: Thu 27 May 2010 15:01

NaN - not a Number

Post by ralle1 » Thu 08 Mar 2012 08:32

Hello!

we've got the following problem:

We use an IBCQuery with ReadOnly=false (formaly RequestLive) to update a table-row in a Firebird Database (2.1 or 2.5). There is a column with type "double precesion" which contains a NaN-Value.

The update fails with an exception at the post-command because the update-statemant generated from IBCQuery is invalid in the Where-clause because of the NaN-Value.

We took a look at the sourcecode in unit MemData. The exception occurs in TMemData.CompareFieldValue when calling BitConverter.Int64BitsToDouble.

Is it possible to fix the problem at this position by checking the value for NaN (or Infinity) or can you tell us an other solution?

Thank you for your help.

Greetings

AndreyZ

Post by AndreyZ » Mon 12 Mar 2012 11:23

Hello,

The point is that Firebird doesn't support NaN values. For more information, please refer to the following bugs on the Firebird's tracker:
http://tracker.firebirdsql.org/browse/CORE-2160
http://tracker.firebirdsql.org/browse/CORE-2505
http://tracker.firebirdsql.org/browse/CORE-2581
http://tracker.firebirdsql.org/browse/CORE-2582
To solve the problem, you should update your DOUBLE PRECISION fields and set the Null value instead of NaN to them. Please contact the Firebird developers and ask about a correct way of doing it.

Post Reply