Skip to content

Bug in Prime Tests, gcd != 1 #31

@furun

Description

@furun

There is a bug in some prime tests.

This lines are wrong, it fails to detect if gcdTest.dataLength > 1

if (gcdTest.dataLength == 1 && gcdTest.data[0] != 1)

it should be

if (gcdTest.dataLength > 1 || gcdTest.dataLength == 1 && gcdTest.data[0] != 1)

(I replaced all this check with IsNegative, IsOne, IsOdd, etc.
Sad that this code is not supposed anymore, it is the best c# code I know)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions