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.2.1.98 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.97 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.96 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.95 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.94 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.93 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.92 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.91 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.90 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.89 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.88 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.87 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.86 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.85 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.84 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.83 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.82 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.81 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.80 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.79 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d