Opened 3 years ago

Closed 3 years ago

# py3: fix one doctest in French book

Reported by: Owned by: chapoton major sage-8.8 python3 tscrim, vklein Frédéric Chapoton Travis Scrimshaw N/A f81acd9 f81acd951b977a257be0df276b15c47c18ae4942

### Description

by marking it as random

### comment:1 Changed 3 years ago by chapoton

• Branch set to u/chapoton/27574
• Commit set to f81acd951b977a257be0df276b15c47c18ae4942
• Status changed from new to needs_review

New commits:

 ​f81acd9 `py3: mark one doctest as random in the French book`

### comment:4 Changed 3 years ago by tscrim

I don't really like marking tests as random when there is exact output. I think the better thing to do is to change the test to check that the output matches something explicit.

### comment:5 Changed 3 years ago by chapoton

Well, I have not read the book, but this precise doctest is probably here to display an example of bad answer, by lack of sufficient precision...

### comment:6 Changed 3 years ago by chapoton

page 201 of the book (http://sagebook.gforge.inria.fr/english.html)

```Let us continue. For the following system, J.variety() computes (exactly) a
triangular decomposition of J, then finds numerically the real solutions of the
obtained system(s). This yields a unique real solution:

sage: R.<x,y> = QQ[]; J = ideal([ x^7-(100*x-1)^2, y-x^7+1 ])
sage: J.variety(RealField(51))
[{y: 396340.890166545, x: -14.1660266425312}]

Yet, by performing the computation exactly until the end, we see there are three
real solutions, and the value of x in the above numerical solution is completely
wrong:
```

### comment:7 Changed 3 years ago by tscrim

Based on that, I am more convinced that we should make sure it is testing the correct output and not just something from a valid computation. However, there is something very annoying happening when I try to test against the value exactly. The `x` value does not quite match despite having the same digits displayed. So I guess we just have to let this be with `# random`. `:/`

### comment:8 Changed 3 years ago by tscrim

• Reviewers set to Travis Scrimshaw
• Status changed from needs_review to positive_review

### comment:9 Changed 3 years ago by vbraun

• Branch changed from u/chapoton/27574 to f81acd951b977a257be0df276b15c47c18ae4942
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.