Improve formatting for various types
cmpute opened this issue · 0 comments
cmpute commented
- For
UBig
/IBig
-
Implement(Wait until the format flags are exposed through public API){:x?}
and{:X?}
formatting
-
- For
FBig
- Implement
{:x}
and{:X}
formatting for base 2. It should print the float as something like0xabcp-n
. - Implement
{:e}
and{:E}
formatting. It should prints999e-n
for base 10, andxxx@-yy
for other bases.
- Implement
- 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
- Implement
(See here for repeatant detection implementation example)