Skip to content

dubbo泛化调用,float类型数据结果不正确 #3861

@tangzhenhuang

Description

@tangzhenhuang
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.8.5
  • Operating System version: mac os 10.14
  • Java version: 1.8.0_191

Steps to reproduce this issue

  1. dubbo provider返回类型为Float或者带有float的时候:
Float test();

implements为:

@Override
    public Float test() {
        return 99.8F;
    }
  1. 消费者为泛化调用:
    Object result = genericService.$invoke(methodName, parameterTypes, params); //泛化调用刚刚的方法

Expected Result

结果不出意料的化应当是99.8

Actual Result

实际得到的是99.80000305175781
image

当我把上诉的Float类型改成Double的时候却不会出现这个情况(泛化调用float类型精度会丢失?)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions