Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Precision problem in Sybase

 
Joe Cheung
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what format of data are you using?
may be you should try to change the format.
 
Campbell Ritchie
Sheriff
Posts: 48910
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic