Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve formatting for various types #10

Open
2 of 7 tasks
cmpute opened this issue Nov 15, 2022 · 0 comments
Open
2 of 7 tasks

Improve formatting for various types #10

cmpute opened this issue Nov 15, 2022 · 0 comments
Milestone

Comments

@cmpute
Copy link
Owner

cmpute commented Nov 15, 2022

  • For UBig / IBig
    • Implement {:x?} and {:X?} formatting (Wait until the format flags are exposed through public API)
  • For FBig
    • Implement {:x} and {:X} formatting for base 2. It should print the float as something like 0xabcp-n.
    • Implement {:e} and {:E} formatting. It should prints 999e-n for base 10, and xxx@-yy for other bases.
  • For RBig / Relaxed
    • Implement Debug
    • Implement {:b}, {:x}, {:X} by printing the components separately
    • Implement .in_radix() by printing the components separately
    • Implement .in_expanded() by printing the decimal form, which prints to certain digits after the radix point by default. It will support {:e}, {:E} as well. It should also supports printing the repeatant with the alternative flag set. Might also support other radices as well.
      format!("{}", rbig!(1/3).in_expanded(10)) -> 1.3333333 (maybe depends on the word size)
      format!("{:.4}", rbig!(1/3).in_expanded(10)) -> 1.3333
      format!("{:#.4}", rbig!(1/3).in_expanded(10)) -> 1.(3)
      format!("{:e}", rbig!(1/3).in_expanded(10)) -> 1.3e0
      format!("{:.4e}", rbig!(1/3).in_expanded(10)) -> 1.3333e0
      

(See here for repeatant detection implementation example)

@cmpute cmpute added this to the v0.4 milestone Nov 15, 2022
@cmpute cmpute modified the milestones: v0.4, v0.5 Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant