lean-ja / lean-ja/lean-by-example
接頭辞付きの数値
Open
Nobody has claimed this yet.
付録アイデア
- Dominant language
- Lean
- Stars
- 188
- Forks
- 15
- Avg merge
- 9h 8m
- Merged PRs (30d)
- 6
Description
モチベーションは、「小さすぎる数値を見てゼロを数えたり、大きすぎる数値を見て桁を数えたりするのは面倒なので自動で見やすく情報を落としてくれる仕組みが欲しい」
単なる Float をラップして、接頭辞(メガとかマイクロとかナノとか)を持つ構造体を定義する。この構造体に PFloat (pretty と prefixから)と名前をつける。
あとは
- Float からPFloat に変換する関数
- PFloat の ToStringインスタンス
を用意すればOK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no file, module, or test; first locate the relevant Lean example or numeric-value entry point in the repository. Define the PFloat structure, provide Float-to-PFloat conversion, and add its ToString instance; done means prefixed values render in a more readable form.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100