Sha256: afa259d60d6364b4173563807d81188e94d5c8803999b8a56fa22c050342e331

Contents?: true

Size: 568 Bytes

Versions: 213

Compression:

Stored size: 568 Bytes

Contents

module difference_of_squares;

unittest {
const int allTestsEnabled = 0;

    assert(squares(5).squareOfSum == 225);
static if (allTestsEnabled) {
    assert(squares(10).squareOfSum == 3_025);
    assert(squares(100).squareOfSum == 25_502_500);

    assert(squares(5).sumOfSquares == 55);
    assert(squares(10).sumOfSquares == 385);
    assert(squares(100).sumOfSquares == 338_350);

    assert(squares(0).difference == 0);
    assert(squares(5).difference == 170);
    assert(squares(10).difference == 2_640);
    assert(squares(100).difference == 25_164_150);
}

}

Version data entries

213 entries across 213 versions & 1 rubygems

Version Path
trackler-2.1.0.41 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.40 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.39 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.38 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.37 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.36 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.34 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.33 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.32 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.31 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.30 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.29 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.1.0.28 tracks/dlang/exercises/difference-of-squares/source/difference_of_squares.d