Project

General

Profile

Bug #938

ReadExpr: misreads 2/3^4

Added by John Abbott over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
Maths Bugs
Start date:
06 Oct 2016
Due date:
% Done:

100%

Estimated time:
2.60 h
Spent time:

Description

After my change to ReadExpr so that it can read rational numbers, the fn now misreads "2/3^4" and produces 16/81 instead of 2/81.

Rectify! And add a test!


Related issues

Related to CoCoA-5 - Feature #909: ReadExpr: decimal pointClosed2016-07-14

Related to CoCoALib - Bug #936: ReadExpr: cannot handle exponent which is not integer literalClosed2016-10-05

History

#1 Updated by John Abbott over 7 years ago

It is a slightly subtle bug: at first sight it seems reasonable that <constant>^<integer> should yield the obvious power of the constant, but this is not how I read 2/3^4.

#2 Updated by John Abbott over 7 years ago

#3 Updated by John Abbott over 7 years ago

  • Status changed from New to In Progress
  • Assignee set to John Abbott
  • % Done changed from 0 to 10

I see no choice but to make 2/3^4 read as an expression div(2, power(3,4)), and this implies that all rationals expressed as explicit quotients have to be read as an expression div(...,...).

#4 Updated by John Abbott over 7 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 10 to 90

I have fixed it now, and added a new test-RingElem5 for the function ReadExpr (for rational numbers).

Trickier than expected; also not so easy coming up with the various test cases.

#5 Updated by John Abbott over 7 years ago

  • Related to Bug #936: ReadExpr: cannot handle exponent which is not integer literal added

#6 Updated by John Abbott over 7 years ago

  • Target version changed from CoCoALib-0.99560 to CoCoALib-0.99550 spring 2017

#7 Updated by John Abbott over 7 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100
  • Estimated time set to 2.60 h

Also available in: Atom PDF