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