Sha256: 9e393bf2a5afcce5dccc46b53433427ec8004be8c67fd619953f6816b6b1a290

Contents?: true

Size: 218 Bytes

Versions: 159

Compression:

Stored size: 218 Bytes

Contents

local
  fun square n = n * n
  fun sum n = n * (n + 1) div 2
in
  val squareOfSum = square o sum
  fun sumOfSquares n = n * (n + 1) * (2 * n + 1) div 6
  fun differenceOfSquares n = squareOfSum n - sumOfSquares n 
end

Version data entries

159 entries across 159 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.118 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.117 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.116 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.115 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.114 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.113 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.111 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.110 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.109 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.108 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.107 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.106 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.105 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.104 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.103 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.102 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.101 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.100 tracks/sml/exercises/difference-of-squares/example.sml
trackler-2.2.1.99 tracks/sml/exercises/difference-of-squares/example.sml