Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005

    Unanswered: Sybase float Precision issues with Java

    I am using a java program to pull a float variable from a source Sybase database table and insert it into a different target Sybase database table. Both source and target columns are defined as float.

    The precision mysteriously increases in the target datasource.
    Source value = 105.74702
    Target value = 105.747017

    The Sybase DB version is 12.5.2. I am using jConnect5.5 as the JDBC driver.

    I have precision decrease but never increase. Any help on this would be much appreciated.


  2. #2
    Join Date
    Aug 2004
    It looks like your value must be moving though a 4-byte float variable at some point. In Sybase, float is an 8-byte value and therefore has about 15 decimal digits of precision. A 4-byte float has about 7 or 8 decimal digits of precision. As you are losing precision in the 7th-8th digit range I suspect that your Java variable holds only 4-bytes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts