Am 01.02.2014 um 14:19 schrieb Jeffrey Schmitz <[email protected]>:

> Hello List,
> 
>    I have an operation that updates many attributes on about 150 rows of data 
> in a TeamInfo table.  When doing a saveChanges operation it generates a 
> SELECT statement like the one shown below for about 50 of the rows before it 
> hits the one shown below that raises an exception.  All the previous SELECT's 
> find a single row, but this particular one finds none.
> 
> The reason it's not finding a row is because of the value it's generating for 
> finding a Double typed value.  For some reason it's using 72.60000000000001 
> but the value in the database is showing 72.6 (see bottom image).  I went 
> through the debugger and stopped to the line where the value is set, and it 
> is setting it to 72.6 (see image below).  
> 
> Sounds like some kind of nasty rounding/floating point representation problem 
> going on so I'm wondering what I could do to guard against this?   

Switch to BigDecimal. Do not use floating point values with equality checks.

Maik

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to