From 07fc041d7bc0793318dd31ebef6ab2da9bcb3fe2 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Mon, 5 Dec 2022 02:14:51 -0500 Subject: Vendor tcllib linear algebra --- vendor/math/fuzzy.testscript | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 vendor/math/fuzzy.testscript (limited to 'vendor/math/fuzzy.testscript') diff --git a/vendor/math/fuzzy.testscript b/vendor/math/fuzzy.testscript new file mode 100644 index 00000000..a27f21fc --- /dev/null +++ b/vendor/math/fuzzy.testscript @@ -0,0 +1,21 @@ +# Rough tests for math::fuzzy procs +# To do: convert to Tcltest + +package require math::fuzzy +namespace import ::math::fuzzy::* + +puts "[teq 1.0 1.001] - expected: 0" +puts "[teq 1.0 1.0000000000000000001] - expected: 1" +puts "[tne 1.0 1.001] - expected: 1" +puts "[tne 1.0 1.0000000000000000001] - expected: 0" +puts "[tgt 1.0 1.001] - expected: 0" +puts "[tgt 1.0 1.0000000000000000001] - expected: 0" + +set x 0.11 +set y [expr {(($x*11.0)-$x)-0.1}] +set z 1.0 +puts "X: $x" +puts "Y: $y" +puts "Z: $z" +puts "Floor: [tfloor $y] ([expr {floor($y)}])" +puts "Ceil: [tceil $y] ([expr {ceil($y)}])" -- cgit v1.2.3