Opened 7 years ago
Closed 7 years ago
#18337 closed enhancement (fixed)
Add methods `real` and `imag` to real interval field
Reported by:  vdelecroix  Owned by:  

Priority:  major  Milestone:  sage6.7 
Component:  basic arithmetic  Keywords:  
Cc:  Merged in:  
Authors:  Vincent Delecroix  Reviewers:  Marc Mezzarobba 
Report Upstream:  N/A  Work issues:  
Branch:  5f5d792 (Commits, GitHub, GitLab)  Commit:  5f5d7922635f713194f0f3f9a9215148828a4e4f 
Dependencies:  Stopgaps: 
Description (last modified by )
For coherence we should have imag
defined on real intervals:
sage: RR(3).real() 3.00000000000000 sage: RR(3).imag() 0
see also: #18334
Change History (6)
comment:1 Changed 7 years ago by
 Branch set to u/vdelecroix/18337
 Commit set to 58dbde182a2c1e174946be9ff87f74439d8c4535
 Status changed from new to needs_review
comment:2 Changed 7 years ago by
 Commit changed from 58dbde182a2c1e174946be9ff87f74439d8c4535 to 5f5d7922635f713194f0f3f9a9215148828a4e4f
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
5f5d792  Trac 18337: .imag() for real intervals

comment:3 Changed 7 years ago by
 Description modified (diff)
comment:4 followup: ↓ 5 Changed 7 years ago by
 Reviewers set to Marc Mezzarobba
 Status changed from needs_review to positive_review
Lgtm. But I more and more think that there should be common base classes for all “reallike” and “complexlike” fields rather than separate implementations of stuff like that in every single one.
comment:5 in reply to: ↑ 4 Changed 7 years ago by
Replying to mmezzarobba:
Lgtm. But I more and more think that there should be common base classes for all “reallike” and “complexlike” fields rather than separate implementations of stuff like that in every single one.
+1... and some normalization too, I found the following very bad
sage: RDF(1)**(1/3) NaN sage: RR(1)**(1/3) 0.500000000000000 + 0.866025403784439*I sage: AA(1)**(1/3) 1
Thanks for the review.
comment:6 Changed 7 years ago by
 Branch changed from u/vdelecroix/18337 to 5f5d7922635f713194f0f3f9a9215148828a4e4f
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
Trac 18334: sign and truncations for real intervals
Trac 18337: .imag() for real intervals