File tree Expand file tree Collapse file tree 7 files changed +18
-18
lines changed Expand file tree Collapse file tree 7 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ test "expf() special" {
218
218
try expectEqual (expf (1.0 ), math .e );
219
219
try expectEqual (expf (math .ln2 ), 2.0 );
220
220
try expectEqual (expf (math .inf (f32 )), math .inf (f32 ));
221
- try expectEqual ( expf (- math .inf (f32 )), 0.0 );
221
+ try expect ( math . isPositiveZero ( expf (- math .inf (f32 ))) );
222
222
try expect (math .isNan (expf (math .nan (f32 ))));
223
223
try expect (math .isNan (expf (math .snan (f32 ))));
224
224
}
@@ -268,7 +268,7 @@ test "exp() special" {
268
268
// try expectEqual(exp(1.0), math.e);
269
269
try expectEqual (exp (math .ln2 ), 2.0 );
270
270
try expectEqual (exp (math .inf (f64 )), math .inf (f64 ));
271
- try expectEqual ( exp (- math .inf (f64 )), 0.0 );
271
+ try expect ( math . isPositiveZero ( exp (- math .inf (f64 ))) );
272
272
try expect (math .isNan (exp (math .nan (f64 ))));
273
273
try expect (math .isNan (exp (math .snan (f64 ))));
274
274
}
Original file line number Diff line number Diff line change @@ -464,7 +464,7 @@ test "exp2f() special" {
464
464
try expectEqual (exp2f (1.0 ), 2.0 );
465
465
try expectEqual (exp2f (-1.0 ), 0.5 );
466
466
try expectEqual (exp2f (math .inf (f32 )), math .inf (f32 ));
467
- try expectEqual ( exp2f (- math .inf (f32 )), 0.0 );
467
+ try expect ( math . isPositiveZero ( exp2f (- math .inf (f32 ))) );
468
468
try expect (math .isNan (exp2f (math .nan (f32 ))));
469
469
try expect (math .isNan (exp2f (math .snan (f32 ))));
470
470
}
@@ -502,7 +502,7 @@ test "exp2() special" {
502
502
try expectEqual (exp2 (1.0 ), 2.0 );
503
503
try expectEqual (exp2 (-1.0 ), 0.5 );
504
504
try expectEqual (exp2 (math .inf (f64 )), math .inf (f64 ));
505
- try expectEqual ( exp2 (- math .inf (f64 )), 0.0 );
505
+ try expect ( math . isPositiveZero ( exp2 (- math .inf (f64 ))) );
506
506
try expect (math .isNan (exp2 (math .nan (f64 ))));
507
507
try expect (math .isNan (exp2 (math .snan (f64 ))));
508
508
}
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ pub fn logl(x: c_longdouble) callconv(.c) c_longdouble {
163
163
test "logf() special" {
164
164
try expectEqual (logf (0.0 ), - math .inf (f32 ));
165
165
try expectEqual (logf (-0.0 ), - math .inf (f32 ));
166
- try expectEqual ( logf (1.0 ), 0.0 );
166
+ try expect ( math . isPositiveZero ( logf (1.0 )) );
167
167
try expectEqual (logf (math .e ), 1.0 );
168
168
try expectEqual (logf (math .inf (f32 )), math .inf (f32 ));
169
169
try expect (math .isNan (logf (-1.0 )));
@@ -198,7 +198,7 @@ test "logf() boundary" {
198
198
test "log() special" {
199
199
try expectEqual (log (0.0 ), - math .inf (f64 ));
200
200
try expectEqual (log (-0.0 ), - math .inf (f64 ));
201
- try expectEqual ( log (1.0 ), 0.0 );
201
+ try expect ( math . isPositiveZero ( log (1.0 )) );
202
202
try expectEqual (log (math .e ), 1.0 );
203
203
try expectEqual (log (math .inf (f64 )), math .inf (f64 ));
204
204
try expect (math .isNan (log (-1.0 )));
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ pub fn log10l(x: c_longdouble) callconv(.c) c_longdouble {
191
191
test "log10f() special" {
192
192
try expectEqual (log10f (0.0 ), - math .inf (f32 ));
193
193
try expectEqual (log10f (-0.0 ), - math .inf (f32 ));
194
- try expectEqual ( log10f (1.0 ), 0.0 );
194
+ try expect ( math . isPositiveZero ( log10f (1.0 )) );
195
195
try expectEqual (log10f (10.0 ), 1.0 );
196
196
try expectEqual (log10f (0.1 ), -1.0 );
197
197
try expectEqual (log10f (math .inf (f32 )), math .inf (f32 ));
@@ -227,7 +227,7 @@ test "log10f() boundary" {
227
227
test "log10() special" {
228
228
try expectEqual (log10 (0.0 ), - math .inf (f64 ));
229
229
try expectEqual (log10 (-0.0 ), - math .inf (f64 ));
230
- try expectEqual ( log10 (1.0 ), 0.0 );
230
+ try expect ( math . isPositiveZero ( log10 (1.0 )) );
231
231
try expectEqual (log10 (10.0 ), 1.0 );
232
232
try expectEqual (log10 (0.1 ), -1.0 );
233
233
try expectEqual (log10 (math .inf (f64 )), math .inf (f64 ));
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ pub fn log2l(x: c_longdouble) callconv(.c) c_longdouble {
183
183
test "log2f() special" {
184
184
try expectEqual (log2f (0.0 ), - math .inf (f32 ));
185
185
try expectEqual (log2f (-0.0 ), - math .inf (f32 ));
186
- try expectEqual ( log2f (1.0 ), 0.0 );
186
+ try expect ( math . isPositiveZero ( log2f (1.0 )) );
187
187
try expectEqual (log2f (2.0 ), 1.0 );
188
188
try expectEqual (log2f (math .inf (f32 )), math .inf (f32 ));
189
189
try expect (math .isNan (log2f (-1.0 )));
@@ -219,7 +219,7 @@ test "log2f() boundary" {
219
219
test "log2() special" {
220
220
try expectEqual (log2 (0.0 ), - math .inf (f64 ));
221
221
try expectEqual (log2 (-0.0 ), - math .inf (f64 ));
222
- try expectEqual ( log2 (1.0 ), 0.0 );
222
+ try expect ( math . isPositiveZero ( log2 (1.0 )) );
223
223
try expectEqual (log2 (2.0 ), 1.0 );
224
224
try expectEqual (log2 (math .inf (f64 )), math .inf (f64 ));
225
225
try expect (math .isNan (log2 (-1.0 )));
Original file line number Diff line number Diff line change @@ -288,8 +288,8 @@ fn expm1_64(x_: f64) f64 {
288
288
}
289
289
290
290
test "expm1_32() special" {
291
- try expectEqual ( expm1_32 (0.0 ), 0.0 );
292
- try expectEqual ( expm1_32 (-0.0 ), 0.0 );
291
+ try expect ( math . isPositiveZero ( expm1_32 (0.0 )) );
292
+ try expect ( math . isNegativeZero ( expm1_32 (-0.0 )) );
293
293
try expectEqual (expm1_32 (math .ln2 ), 1.0 );
294
294
try expectEqual (expm1_32 (math .inf (f32 )), math .inf (f32 ));
295
295
try expectEqual (expm1_32 (- math .inf (f32 )), -1.0 );
@@ -326,8 +326,8 @@ test "expm1_32() boundary" {
326
326
}
327
327
328
328
test "expm1_64() special" {
329
- try expectEqual ( expm1_64 (0.0 ), 0.0 );
330
- try expectEqual ( expm1_64 (-0.0 ), 0.0 );
329
+ try expect ( math . isPositiveZero ( expm1_64 (0.0 )) );
330
+ try expect ( math . isNegativeZero ( expm1_64 (-0.0 )) );
331
331
try expectEqual (expm1_64 (math .ln2 ), 1.0 );
332
332
try expectEqual (expm1_64 (math .inf (f64 )), math .inf (f64 ));
333
333
try expectEqual (expm1_64 (- math .inf (f64 )), -1.0 );
Original file line number Diff line number Diff line change @@ -184,8 +184,8 @@ fn log1p_64(x: f64) f64 {
184
184
}
185
185
186
186
test "log1p_32() special" {
187
- try expectEqual ( log1p_32 (0.0 ), 0.0 );
188
- try expectEqual ( log1p_32 (-0.0 ), 0.0 );
187
+ try expect ( math . isPositiveZero ( log1p_32 (0.0 )) );
188
+ try expect ( math . isNegativeZero ( log1p_32 (-0.0 )) );
189
189
try expectEqual (log1p_32 (-1.0 ), - math .inf (f32 ));
190
190
try expectEqual (log1p_32 (1.0 ), math .ln2 );
191
191
try expectEqual (log1p_32 (math .inf (f32 )), math .inf (f32 ));
@@ -219,8 +219,8 @@ test "log1p_32() boundary" {
219
219
}
220
220
221
221
test "log1p_64() special" {
222
- try expectEqual ( log1p_64 (0.0 ), 0.0 );
223
- try expectEqual ( log1p_64 (-0.0 ), 0.0 );
222
+ try expect ( math . isPositiveZero ( log1p_64 (0.0 )) );
223
+ try expect ( math . isNegativeZero ( log1p_64 (-0.0 )) );
224
224
try expectEqual (log1p_64 (-1.0 ), - math .inf (f64 ));
225
225
try expectEqual (log1p_64 (1.0 ), math .ln2 );
226
226
try expectEqual (log1p_64 (math .inf (f64 )), math .inf (f64 ));
You can’t perform that action at this time.
0 commit comments