Skip to content

bug in divides #5759

@williamstein

Description

@williamstein

The function "divides" does not work for generic commutative rings.

  1. it is not checked that the elements are in the same space, i.e.

Zmod(5)(1).divides(Zmod(2)(1)) is "True"

  1. No division by zero checking is done! This gives for example an error if you type

    -> Zmod(2).zero_ideal() == Zmod(2).zero_ideal()

    -> Zmod(2).zero_ideal() == Zmod(2).unit_ideal()

This patch should fix this. It may not be able to handle all cases but classes who need a more clever function should do their own implementation anyways.

Greetings,
Kilian.

Component: basic arithmetic

Author: Luis Felipe Tabera

Reviewer: John Cremona

Merged: sage-4.6.alpha3

Issue created by migration from https://trac.sagemath.org/ticket/5759

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions