Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #17218: rename attribute Acb.precision to Acb._precision_
Browse files Browse the repository at this point in the history
The precision should be stored in the parent once such a parent
exists. Meanwhile, we rename precision to _precision_ in order to ease
the transition later on.
  • Loading branch information
cheuberg committed Oct 25, 2014
1 parent 4b9cded commit 65fa1e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/sage/rings/complex_interval_acb.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ cdef ComplexIntervalFieldElement acb_to_ComplexIntervalFieldElement(

cdef class Acb(SageObject):
cdef acb_t value
cdef unsigned long precision
cdef unsigned long _precision_
cpdef ComplexIntervalFieldElement ComplexIntervalFieldElement(self)
6 changes: 3 additions & 3 deletions src/sage/rings/complex_interval_acb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ cdef class Acb(SageObject):

if value is None:
if precision > 0:
self.precision = precision
self._precision_ = precision
else:
raise TypeError("precision must be given.")
elif isinstance(value, ComplexIntervalFieldElement):
element = <ComplexIntervalFieldElement> value
self.precision = value.parent().precision()
self._precision_ = value.parent().precision()
ComplexIntervalFieldElement_to_acb(self.value, element)

else:
Expand All @@ -193,4 +193,4 @@ cdef class Acb(SageObject):
2 + 2*I
"""

return acb_to_ComplexIntervalFieldElement(self.value, self.precision)
return acb_to_ComplexIntervalFieldElement(self.value, self._precision_)

0 comments on commit 65fa1e5

Please sign in to comment.