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.180 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.179 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.178 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.177 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.176 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.175 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.174 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.173 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.172 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.171 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.170 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.169 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.167 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.166 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.165 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.164 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.163 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.162 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.161 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d
trackler-2.2.1.160 tracks/d/exercises/difference-of-squares/source/difference_of_squares.d