两表,都为一列一行,列的数据类型dt1:System.Single,dt2: System.Decimal;值为dt1: 1.5795728, dt2: 1.5796。我希望通过比较两值之差是否小于0.0001来判断两表是否相等,要怎么做呢?我的代码如下,但是抛错:
Operator '-' cannot be applied to operands of type 'object' and 'object'if (Math.Abs(dt1.Rows[0][0] - dt2.Rows[0][0]) > 0.0001)
  Console.WriteLine("false");
else
  Console.WriteLine("true");先谢过了。