cloudwu / cloudwu/sproto

proposal:去掉定点数

Open
#104 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
982
Forks
254
PR merge metrics
No merged PRs in 30d

Description

有两个问题:

  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其实也没区别了。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the fixed-point implementations in the C and Lua versions, then compare their behavior with sproto's existing double support. The issue does not name files or tests, and completion would require a maintainer decision on whether fixed-point support should be removed or redesigned with decimal types.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.