8000 proposal:去掉定点数 · Issue #104 · cloudwu/sproto · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
proposal:去掉定点数 #104
Open
@xjdrew

Description

@xjdrew

有两个问题:

  1. 目前c/lua版本的实现不正确:现在定点数的内部实现,是用double,还是会丢失精度,并没有正确实现定点数。c23 会增加 Decimal floating-point types (https://en.cppreference.com/w/c/23) ,真有定点数的需求,可以考虑用decimal重新实现。

  2. 与double类型功能重合了。sproto目前已经支持double,可以取代定点数。当移植到go这种强类型语言时,很纠结到底用double还是decimal(第三方类型)表示定点数。如果使用double表示定点数,和c/lua版本一致,但本质上和double其实也没区别了。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0