Feature #233
AsINT and AsRAT -- ConvertTo<BigInt> and ConvertTo<BigRat>
Description
Should we implement functions very like AsINT
and AsRAT
in CoCoALib?
What should their names be? Anna suggests AsBigInt
and AsBigRat
?
If so, design them properly!
Anna also points out that AsPolyRing
and other similarly named functions for rings are essentially costless casts whereas AsBigInt
is a costly operation.
2014-01: Final decision is for ConvertTo<BigInt>, ConvertTo<BigRat>
Related issues
History
#1 Updated by John Abbott over 11 years ago
- Status changed from New to In Progress
JAA suggests using the convert
family for achieving this. For instance
RingElem x(...); BigInt N = ConvertTo<BigInt>(x); BigRat Q = ConvertTo<BigRat>(x);
2013-01-30 JAA has made experimental impl of ConvertTo<BigInt>
for RingElem
.
#2 Updated by John Abbott over 11 years ago
If I define ConvertTo
for converting RingElem
into BigInt
, should I define all members of the convert family for performing the conversions? This might make IsInteger
redundant...
#3 Updated by Anna Maria Bigatti about 11 years ago
- Category set to New Function
#4 Updated by John Abbott over 10 years ago
An advantage of Anna's suggested names is that they are more compact than using the ConvertTo
template fn.
JAA suggests looking through CoCoALib source code (and examples?) to see how IsInteger
is used.
PS it'd be nice to close this task soon; it's little more than just a naming issue.
#5 Updated by Anna Maria Bigatti about 10 years ago
- Status changed from In Progress to Feedback
- Assignee set to John Abbott
- Target version set to CoCoALib-0.9953
- % Done changed from 0 to 80
Final decision is for ConvertTo<BigInt> and ConvertTo<BigRat>
#6 Updated by Anna Maria Bigatti about 10 years ago
- Target version changed from CoCoALib-0.9953 to CoCoALib-0.99532
#7 Updated by Anna Maria Bigatti about 10 years ago
- Status changed from Feedback to Closed
- % Done changed from 80 to 100
- Estimated time set to 2.00 h
Please note that ConvertTo<..>(N)
also allows passing an error message
ConvertTo<long>(NumIndets, ErrMesg) <\pre>
#8 Updated by Anna Maria Bigatti about 10 years ago
- Subject changed from AsINT and AsRAT to AsINT and AsRAT -- ConvertTo<BigInt> and ConvertTo<BigRat>