This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Precision problem in Sybase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Precision problem in Sybase" Watch "Precision problem in Sybase" New topic

Precision problem in Sybase

Joe Cheung
Ranch Hand

Joined: Oct 18, 2002
Posts: 104
I tried to insert a double value "0.0491" in Sybase. I found that the value stored in the table is "0.04909999999" that I think is precision loss problem. Does anyone know what the problem is and how I can insert the value exactly "0.0491" rather than "0.04909999999"

Shoumin Li
Ranch Hand

Joined: Jul 06, 2007
Posts: 85
what format of data are you using?
may be you should try to change the format.

Java Blog
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 37907
It is a standard problem with floating-point arithmetic in any computer.
Does Sybase support a "decimal" data type? That should sort out your problems.
subject: Precision problem in Sybase
Similar Threads
loss of pression
Retrieving Primary key
Insert/update TEXT field in SYBASE?
Rounding problem
maximum length of identitifer in Sybase for insert query