#713: Too little MMD? i_add doesn't know about subclasses.
-------------------+--------------------------------------------------------
Reporter: coke | Owner:
Type: bug | Status: new
Priority: major | Milestone:
Component: core | Version: trunk
Severity: high | Keywords: tcl blocker
Lang: | Patch:
Platform: |
-------------------+--------------------------------------------------------
Comment(by Infinoid):
Replying to [comment:6 whiteknight]:
> The big problem with this change that I can see is that Integer.i_add
for some reason defaults to use set_number_native. That is not a sane
fallback by any standards. Why should the result of an i_add on integer
produce a floating point value?
I believe the intention is that if it doesn't recognize the second value
as an integer type, it assumes float so that it won't lose any precision.
With that default, "1 += 1.2" will result in 2.2, otherwise the result
would be 2. That's my best guess, anyway, and I can't speak for whether
the design is right here.
Also note, the TT #452 branch consolidates Integer's add and i_add
functions, fixes the Complex case (which didn't make any attempt to
preserve the imaginary portion), and automatically upgrades to BigInt when
necessary. I generated this patch to test whether we understood the issue
correctly, but in general, I'd prefer to coordinate with that branch
rather than applying a specific fix for this (and causing merge
conflicts).
Mark
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/713#comment:7>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets