Project

General

Profile

Feature #1410

IsDivisible also for INT

Added by John Abbott about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
High
Category:
enhancing/improving
Target version:
Start date:
03 Feb 2020
Due date:
% Done:

100%

Estimated time:
2.01 h
Spent time:

Description

In CoCoALib IsDivisible works for various types of value, including integers.
In CoCoA-5, it expects just a RINGELEM.

Extend it to work with INT too?

History

#1 Updated by John Abbott about 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

I have been caught out by this myself on several occasions. I know one can use mod instead, but it is more expressive if one can write IsDivisible(a,b).

Florian asked me about it today (over lunch).

It should be easy to implement; should we? Shall we?

#2 Updated by Anna Maria Bigatti about 4 years ago

John Abbott wrote:

I have been caught out by this myself on several occasions. I know one can use mod instead, but it is more expressive if one can write IsDivisible(a,b).

I agree.
So, it is just to add all the compbination of types (somehow) for cocoa-5?

#3 Updated by John Abbott about 4 years ago

  • % Done changed from 10 to 20
Yes. I think there are probably just two (main) cases:
  • RINGELEM and RINGELEM
  • INT and INT
  • not so sure about INT and RINGELEM (or RINGELEM and INT)

#4 Updated by Anna Maria Bigatti about 4 years ago

  • Assignee set to Anna Maria Bigatti

done

/**/ use QQ[x];
/**/ IsDivisible(9,3);
true
/**/ IsDivisible(9,2);
false
/**/ IsDivisible(9*x,2);  -- 9*x is in QQ[x], so divisible by any constant!!
true
/**/ use ZZ[x];
/**/ IsDivisible(9*x,2);
false

#5 Updated by Anna Maria Bigatti about 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 20 to 100
  • Estimated time set to 2.01 h

manual done

Also available in: Atom PDF