Skip to content

Add warning for is_prime(n) that produce correct but unexpected output #25046

@roed314

Description

@roed314

The following will be confusing to casual users of Sage:

sage: p = (2^4-1)/3
sage: p
5
sage: is_prime(p)
False
sage: p.is_prime()
False

As suggested on https://groups.google.com/forum/#!topic/sage-devel/NN0VP-OVZLw, we should show a warning when a function like is_prime is called in such a context. The seems to arise most frequently for fields, where general definitions necessitate a certain answer, but that answer is not consistent with subrings where the question has more arithmetic interest.

CC: @kcrisman

Component: user interface

Author: Lorenz Panny

Branch/Commit: c6a47f2

Reviewer: Kwankyu Lee

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions