List:MySQL++« Previous MessageNext Message »
From:Ken Smith Date:March 23 2009 10:39pm
Subject:Insertion of Infinity and Not-a-Number values using MySQL++
View as plain text  
Hi
 
Sorry if this is in an FAQ somewhere, but I can't find anything...
 
I have a large amount of scientific data to ingest which consists of many floating point
numbers, some of which are deliberately set to not-a-number (NaN) or +/- infinity.  I
don't need to preserve the type of NaN, but I do want to set the value to NULL upon
ingest.
 
Running MySQL inserts from the command line appears to show that MySQL interprets
not-a-number values by default as NULLs when attempting an insert.  E.g.:
 
insert into my_float_table values (sqrt(-1));
insert into my_float_table values (1.0/0.0);
 
yeilds NULL values in my table.
 
This is fine, and is the behaviour I want.
 
However, if I use MySQL++ to insert a variable whose value is a NaN, the result is a
*ZERO* in my table, not a NULL value, as I expected.  This is bad for me because zero is,
of course, a valid number.
 
What do I need to do to get MySQL++ to behave in the same way as doing an insert from the
command line?
 
Thanks in advance,
 
Ken
 
_________________________________________________________________
 25GB of FREE Online Storage – Find out more
http://clk.atdmt.com/UKM/go/134665320/direct/01/
Thread
Insertion of Infinity and Not-a-Number values using MySQL++Ken Smith23 Mar
  • Re: Insertion of Infinity and Not-a-Number values using MySQL++Warren Young24 Mar
    • RE: Insertion of Infinity and Not-a-Number values using MySQL++Ken Smith24 Mar
    • Re: Insertion of Infinity and Not-a-Number values using MySQL++Warren Young24 Mar