Opened 9 years ago
Closed 9 years ago
#13286 closed defect (fixed)
inconsistent behaviour of solve
Reported by: | chapoton | Owned by: | burcin |
---|---|---|---|
Priority: | minor | Milestone: | sage-5.3 |
Component: | symbolics | Keywords: | solve, symbolic |
Cc: | Merged in: | sage-5.3.beta2 | |
Authors: | Punarbasu Purkayastha | Reviewers: | Frédéric Chapoton |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
I have found the following :
sage: w,z=var('w','z') sage: solve([z-4,w-3],[z,w]) [[z == 4, w == 3]] sage: solve([z-4],z) [z == 4] sage: solve([z-4,z-2],z) [] sage: solve([z-4,z-2],[z]) [] sage: solve([z-4],[z]) TypeError: [z] is not a valid variable.
The last line is a really *bad* behaviour ! It forces to distinguish the case when there is only one equation and one variable. Compare also with the first solve.
Attachments (1)
Change History (9)
comment:1 Changed 9 years ago by
comment:3 Changed 9 years ago by
comment:4 follow-up: ↓ 5 Changed 9 years ago by
Thanks for the ticket. Are you sure of the syntax of the links to trac ? According to #12490, it seems rather to be
:trac:`13077`
with no # inside.
comment:5 in reply to: ↑ 4 Changed 9 years ago by
Replying to chapoton:
Thanks for the ticket. Are you sure of the syntax of the links to trac ?
Thanks for checking this. Indeed, it was incorrect. Have corrected the patch now.
comment:6 Changed 9 years ago by
- Status changed from needs_review to positive_review
ok, positive review
comment:7 Changed 9 years ago by
- Reviewers set to Frédéric Chapoton
comment:8 Changed 9 years ago by
- Merged in set to sage-5.3.beta2
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
At first I thought this was part of #10750, but apparently not. Thanks for this report.
On the plus side, the behavior isn't that bad; it doesn't return a mathematically wrong result, gives a readable error message (this doesn't always happen in Sage!), and by reading
solve?
one can see the proper syntax. It isn't a good thing, but isn't horrendous.