From 2f6d654086945b9ed78ca50c2132954c13c40386 Mon Sep 17 00:00:00 2001 From: Rob Goedman Date: Fri, 6 Jun 2014 07:47:48 -0700 Subject: [PATCH] Updated license and test scripts. --- LICENSE.md | 43 ++++++++++++++++++++++---------------- test/test_Paper_example.jl | 5 +++++ test/test_basics.jl | 5 +++-- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index eb41202..cb80524 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -7,25 +7,32 @@ This Julia implementation is directly based on Jeffrey A. Fikes's C++ implementa * * Copyright (c) 2006 Jeffrey A. Fike -See the README.md for more details. + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: -The Julia implementation was written by Rob J. Goedman. + * The Julia implementation was written by Rob J. Goedman. + * + * See the README.md for more details. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/test_Paper_example.jl b/test/test_Paper_example.jl index cb8948d..4be61fa 100644 --- a/test/test_Paper_example.jl +++ b/test/test_Paper_example.jl @@ -30,3 +30,8 @@ println("t8 = ", t8) println() println("f(t0) = ", f(t0)) + +@test abs(f(1.5) - real(f(t0))) < 5eps(1.0) +@test abs(eps1(f(t0))-4.053427893898621) < 5eps(1.0) && eps1(f(t0)) == eps2(f(t0)) +@test abs(eps1eps2(f(t0))-9.463073681596601) < 5eps(1.0) + diff --git a/test/test_basics.jl b/test/test_basics.jl index f7e1dc1..7bfe7ab 100644 --- a/test/test_basics.jl +++ b/test/test_basics.jl @@ -25,8 +25,9 @@ hdNaN = hyper(0/0) @test hd4-5 == hyper256(-4.0, 4.0, 3.0, 4.0) # NaN tests -#@test hdNaN == hyper(NaN, 0.0, 0.0, 0.0) -#@test hdNaN + hd4 == hyper128(NaN, 4.0, 3.0, 4.0) +@test isnan(hdNaN) == isnan(hyper(NaN, 0.0, 0.0, 0.0)) +hdNaN128 = hyper128(NaN, 4.0, 3.0, 4.0) +@test isnan(hdNaN + hd4) == isnan(hdNaN128) && eps1eps2(hdNaN128)==4.0 println("\nExamples of show() for hyperdual numbers with NaN:\n") println("hdNaN = $(hdNaN)")