Opened 5 years ago

Closed 5 years ago

## #23145 closed defect (fixed)

# Interval and ball field elements conversion to Python float/complex

Reported by: | Ralf Stephan | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-8.0 |

Component: | numerical | Keywords: | |

Cc: | Merged in: | ||

Authors: | Ralf Stephan | Reviewers: | Travis Scrimshaw |

Report Upstream: | N/A | Work issues: | |

Branch: | 4138752 (Commits, GitHub, GitLab) | Commit: | 4138752eab7005f881d3e2586b828f92be1b7e0c |

Dependencies: | Stopgaps: |

### Description (last modified by )

Each of `float(RIF(1))`

,`float(RBF(1))`

,`float(CBF(1))`

fails with

TypeError: float() argument must be a string or a number

and `float(CIF(1))`

fails with

TypeError: can't convert complex interval to float

i.e. the `__float__()`

member exists but is not implemented.

### Change History (8)

### comment:1 Changed 5 years ago by

Description: | modified (diff) |
---|

### comment:2 Changed 5 years ago by

Branch: | → u/rws/interval_and_ball_field_elements_conversion_to_python_float_complex |
---|

### comment:3 Changed 5 years ago by

Authors: | → Ralf Stephan |
---|---|

Commit: | → 13bb3b034cf78edcc505c5ccf841db7407ae1b60 |

Status: | new → needs_review |

### comment:4 Changed 5 years ago by

Reviewers: | → Travis Scrimshaw |
---|---|

Status: | needs_review → positive_review |

These should all be there because we can naturally convert to `RR`

, which has coercions to `RDF`

and floats.

### comment:6 Changed 5 years ago by

Commit: | 13bb3b034cf78edcc505c5ccf841db7407ae1b60 → 4138752eab7005f881d3e2586b828f92be1b7e0c |
---|

### comment:7 Changed 5 years ago by

Status: | needs_work → positive_review |
---|

Just a quick fix for a missed doctest.

### comment:8 Changed 5 years ago by

Branch: | u/rws/interval_and_ball_field_elements_conversion_to_python_float_complex → 4138752eab7005f881d3e2586b828f92be1b7e0c |
---|---|

Resolution: | → fixed |

Status: | positive_review → closed |

**Note:**See TracTickets for help on using tickets.

New commits:

`23145: Interval and ball field elements conversion to Python float/complex`