Skip to content

Inherent flaw in PrimeFactor exercise #1309

@nathanchere

Description

@nathanchere

I understand the motivation behind implementing a test which exceeds the 32-bit range:

    [Fact]
    public void Factors_include_a_large_prime()
    {
        Assert.Equal(new[] { 11, 9539, 894119 }, PrimeFactors.Factors(93819012551));
    }

but I think it is misguided at best if not encouraging questionable practice to then have the solution template mixing 32- and 64-bit (public static int[] Factors(long number)) and the tests all testing against an int instead of long. If the student is meant to implement support for 64-bit numbers it should also test against 64-bit values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions