@@ -38,6 +38,75 @@ assert fromNumber(-1.7976931348623157e+309) == -Infinityd
3838assert toNumber(555.0d) == 555
3939assert toNumber(0.0d) == 0
4040
41+ // Float64.pow tests are based on test cases from libc-test: http://nsz.repo.hu/git/?p=libc-test
42+ /*
43+ libc-test is licensed under the following standard MIT license:
44+ Copyright © 2005-2013 libc-test AUTHORS
45+ Permission is hereby granted, free of charge, to any person obtaining
46+ a copy of this software and associated documentation files (the
47+ "Software"), to deal in the Software without restriction, including
48+ without limitation the rights to use, copy, modify, merge, publish,
49+ distribute, sublicense, and/or sell copies of the Software, and to
50+ permit persons to whom the Software is furnished to do so, subject to
51+ the following conditions:
52+ The above copyright notice and this permission notice shall be
53+ included in all copies or substantial portions of the Software.
54+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
55+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
56+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
57+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
58+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
59+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
60+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
61+ Portions of this software is derived from software authored by
62+ third parties:
63+ math tests use numbers under BSD and GPL licenses see src/math/ucb/*
64+ and src/math/crlibm/* for details
65+ */
66+ // pow
67+ assert Float64.isNaN(-8.06684839057968084d ** 4.53566256067686879d)
68+ assert 4.34523984933830487d ** -8.88799136300345083d ==
69+ 0.00000213471188255872853d
70+ assert Float64.isNaN(-8.38143342755524934d ** -2.76360733737958819d)
71+ assert Float64.isNaN(-6.53167358191348413d ** 4.56753527684274374d)
72+ assert 9.26705696697258574d ** 4.81139208435979615d == 44909.2994151296589d
73+ assert Float64.isNaN(-6.45004555606023633d ** 0.662071792337673881d)
74+ assert 7.85889025304169664d ** 0.0521545267500622481d == 1.11351774134586523d
75+ assert Float64.isNaN(-0.792054511984895959d ** 7.67640268511753998d)
76+ assert 0.615702673197924044d ** 2.01190257903248026d == 0.376907735213801831d
77+ assert Float64.isNaN(-0.558758682360915193d ** 0.0322398306026380407d)
78+ assert Float64.isNaN(0.0d ** NaNd)
79+ assert 0.0d ** Infinityd == 0.0d
80+ assert 0.0d ** 3.0d == 0.0d
81+ assert 0.0d ** 2.0d == 0.0d
82+ assert 0.0d ** 1.0d == 0.0d
83+ assert 0.0d ** 0.5d == 0.0d
84+ assert Float64.isNaN(0.0d ** 0.0d)
85+ assert Float64.isNaN(0.0d ** -0.0d)
86+ assert 0.0d ** -0.5d == Infinityd
87+ assert 0.0d ** -1.0d == Infinityd
88+ assert 0.0d ** -Infinityd == Infinityd
89+ assert Float64.isNaN(-0.0d ** NaNd)
90+ assert -0.0d ** Infinityd == 0.0d
91+ assert -0.0d ** 3.0d == -0.0d
92+ assert -0.0d ** 0.5d == 0.0d
93+ assert Float64.isNaN(-0.0d ** 0.0d)
94+ assert Float64.isNaN(-0.0d ** -0.0d)
95+ assert -0.0d ** -0.5d == Infinityd
96+ assert -0.0d ** -1.0d == -Infinityd
97+ assert -0.0d ** -2.0d == Infinityd
98+ assert -0.0d ** -3.0d == -Infinityd
99+ assert -0.0d ** -4.0d == Infinityd
100+ assert -0.0d ** -Infinityd == Infinityd
101+ assert Float64.isNaN(NaNd ** 0.0d)
102+ assert Float64.isNaN(Infinityd ** 0.0d)
103+ assert Float64.isNaN(-Infinityd ** 0.0d)
104+ assert Float64.isNaN(1.0d ** 0.0d)
105+ assert Float64.isNaN(-1.0d ** 0.0d)
106+ assert Float64.isNaN(-0.5d ** 0.0d)
107+ assert Float64.isNaN(NaNd ** -0.0d)
108+ assert 300.0d ** 1.0d == 300.0d
109+
41110assert 5.0d > 4.0d
42111assert 5.0d >= 5.0d
43112assert 5.0d < 17.0d
0 commit comments