Oracle.ManagedDataAccess.Types.OracleDecimal.Value returns corrupted value after SetPrecision — oracle-tech

    Forum Stats

  • 3,716,136 Users
  • 2,242,961 Discussions
  • 7,845,842 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Oracle.ManagedDataAccess.Types.OracleDecimal.Value returns corrupted value after SetPrecision

dunkan
dunkan Member Posts: 1
edited July 2018 in ODP.NET

Hello!

I have found that OracleDecimal lost last digits of an integer value after the SetPrecision method call.

The following test doesn't pass for Oracle.ManagedDataAccess 4.122.1.0 and Oracle.ManagedDataAccess.Core.2.12.0-beta2:

OracleDecimal o5 = new OracleDecimal(10304927536231884057971014491M);OracleDecimal fo5 = OracleDecimal.SetPrecision(o5, 28);decimal fd5 = fo5.Value;Debug.Assert(fd5.ToString() == fo5.ToString());  // fd5 == 1030492753623188405797101449// fo5 == 10304927536231884057971014490

But the same code is ok for Oracle.DataAccess 4.122.1.0.

It seems to be a bug in the Oracle.ManagedDataAccess implementation.

dunkan

Best Answer

Answers

This discussion has been closed.