Feature #533
Convert BigInt/BigRat to string
Description
I thought there used to be ConvertTo<string>(N)
for BigInt
and BigRat
.
Maybe there used to be, but they were removed for some reason (e.g. the "convert" family is only for conversion between arithmetic types?)
The doc says to use ostringstream
instead; that's inconvenient (needs an extra header included, 3 lines instead of 1 fn call).
Reinstate "conversion" of BigInt
and BigRat
to string
?
What should the fns be called?
Related issues
History
#1 Updated by John Abbott about 10 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
I have made a quick impl in file decimal.C
; its currently called decimals
. I had wanted to use DecimalStr
but that's already taken (and has a different meaning).
Is decimal.C
the right place for such a fn?
What about IntOperations.C
? Perhaps that is more for arithmetic?
#2 Updated by John Abbott almost 10 years ago
- Status changed from In Progress to Closed
- Assignee set to John Abbott
- Target version changed from CoCoALib-0.99534 Seoul14 to CoCoALib-0.99533 Easter14
- % Done changed from 10 to 100
- Estimated time set to 7.50 h
This has already been done (by me, but I can't recall exactly when).
There is now a template fn called ToString
; it is bundled with FloatStr
, DecimalStr
and ScientificStr
in a file called ToString
.
Doc & examples have been updated too.