Pure Programmer
Blue Matrix


Cluster Map

Project: Standard Deviation

Write a filter program that accepts text representations of floating point values on the standard input, one per line. The program should then compute the standard deviation of a list of floating point values. Finally the program should simply output the value of the standard deviation to 16 decimal places on a single line so that it can easily be used by other programs.

Output
$ swiftc StandardDeviation.swift -I . -L . -lUtils StandardDeviation.swift:18:6: warning: variable 'd' was never mutated; consider changing to 'let' constant var d:Double = Double(line!) ?? 0.0 ~~~ ^ let error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation) $ swiftc StandardDeviation.swift -I . -L . -lUtils StandardDeviation.swift:18:6: warning: variable 'd' was never mutated; consider changing to 'let' constant var d:Double = Double(line!) ?? 0.0 ~~~ ^ let error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation) $ swiftc StandardDeviation.swift -I . -L . -lUtils StandardDeviation.swift:18:6: warning: variable 'd' was never mutated; consider changing to 'let' constant var d:Double = Double(line!) ?? 0.0 ~~~ ^ let error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution