This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -429,7 +429,16 @@ fn frexpf_cases() -> Vec<TestCase<op::frexpf::Routine>> {
429
429
}
430
430
431
431
fn hypot_cases ( ) -> Vec < TestCase < op:: hypot:: Routine > > {
432
- vec ! [ ]
432
+ let mut v = vec ! [ ] ;
433
+ TestCase :: append_pairs (
434
+ & mut v,
435
+ & [ (
436
+ // Case that can overflow exponent if wrapping arithmetic is not used
437
+ ( hf64 ! ( "-0x1.800f800f80100p+1023" ) , hf64 ! ( "0x1.8354835473720p+996" ) ) ,
438
+ Some ( hf64 ! ( "0x1.800f800f80100p+1023" ) ) ,
439
+ ) ] ,
440
+ ) ;
441
+ v
433
442
}
434
443
435
444
fn hypotf_cases ( ) -> Vec < TestCase < op:: hypotf:: Routine > > {
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ fn cr_hypot(mut x: f64, mut y: f64) -> f64 {
118
118
ex = thd;
119
119
ey = tld;
120
120
ex &= 0x7ff_u64 << 52 ;
121
- let aidr: u64 = ey + ( 0x3fe_u64 << 52 ) - ex ;
121
+ let aidr: u64 = ey. wrapping_add ( 0x3fe_u64 << 52 ) . wrapping_sub ( ex ) ;
122
122
let mid: u64 = ( aidr. wrapping_sub ( 0x3c90000000000000 ) + 16 ) >> 5 ;
123
123
if mid == 0 || !( 0x39b0000000000000_u64 ..=0x3c9fffffffffff80_u64 ) . contains ( & aidr) {
124
124
cold_path ( ) ;
You can’t perform that action at this time.
0 commit comments