File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Precision problem in Sybase" Watch "Precision problem in Sybase" New topic
Author

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"


Joe
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
Sheriff

Joined: Oct 13, 2005
Posts: 39773
    
  28
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Precision problem in Sybase