File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Precision problem in Sybase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 45276
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.
I agree. Here's the link:
subject: Precision problem in Sybase
It's not a secret anymore!