Sum Distances To Origin With Tail Recursion Assignment

From CSE425S Wiki
Jump to navigation Jump to search

Motivation

Gain experience with tail recursion.

Previous Warmup

This warmup is a variation of the Sum Distances To Origin with Functions warmup.

Code To Implement

file: src/main/sml/warmup_sum_distances_to_origin_tail/sum_distances_to_origin.sml Smlnj-logo.png
functions: sum_distances_to_origin

Math.sqrt(v)

fun sum_distances_to_origin(xys : (real * real) list)

Test

source folder: src/test/sml/warmup_sum_distances_to_origin_tail
how to run with CM.make verbosity off: sml -Ccm.verbose=false run_sum_distances_to_origin_tail_testing.sml
how to run with CM.make verbosity on: sml run_sum_distances_to_origin_tail_testing.sml

note: ensure that you have removed all printing to receive credit for any assignment.

SML Error Messages