@@ -391,15 +391,15 @@ Base.checked_fld(x::FD, y::FD) = Base.checked_fld(promote(x, y)...)
391
391
Base. checked_rem (x:: FD , y:: FD ) = Base. checked_rem (promote (x, y)... )
392
392
Base. checked_mod (x:: FD , y:: FD ) = Base. checked_mod (promote (x, y)... )
393
393
394
- Base. checked_add (x, y:: FD ) = Base. checked_add (promote (x, y)... )
395
394
Base. checked_add (x:: FD , y) = Base. checked_add (promote (x, y)... )
396
- Base. checked_sub (x, y:: FD ) = Base. checked_sub (promote (x, y)... )
395
+ Base. checked_add (x, y:: FD ) = Base. checked_add (promote (x, y)... )
397
396
Base. checked_sub (x:: FD , y) = Base. checked_sub (promote (x, y)... )
398
- Base. checked_mul (x, y:: FD ) = Base. checked_mul (promote (x, y)... )
397
+ Base. checked_sub (x, y:: FD ) = Base. checked_sub (promote (x, y)... )
399
398
Base. checked_mul (x:: FD , y) = Base. checked_mul (promote (x, y)... )
400
- Base. checked_div (x, y:: FD ) = Base. checked_div (promote (x, y)... )
399
+ Base. checked_mul (x, y:: FD ) = Base. checked_mul (promote (x, y)... )
401
400
Base. checked_div (x:: FD , y) = Base. checked_div (promote (x, y)... )
402
- Base. checked_cld (x, y:: FD ) = Base. checked_cld (promote (x, y)... )
401
+ Base. checked_div (x, y:: FD ) = Base. checked_div (promote (x, y)... )
402
+ Base. checked_cld (x:: FD , y) = Base. checked_cld (promote (x, y)... )
403
403
Base. checked_cld (x, y:: FD ) = Base. checked_cld (promote (x, y)... )
404
404
Base. checked_fld (x:: FD , y) = Base. checked_fld (promote (x, y)... )
405
405
Base. checked_fld (x, y:: FD ) = Base. checked_fld (promote (x, y)... )
450
450
function Base. checked_abs (x:: FD )
451
451
r = ifelse (x< 0 , - x, x)
452
452
r< 0 || return r
453
- msg = LazyString (" checked arithmetic: cannot compute |x| for x = " , x, " ::" , typeof (x))
454
- throw (OverflowError (msg))
453
+ _throw_overflow_abs (x)
454
+ end
455
+ if VERSION >= v " 1.8.0-"
456
+ @noinline _throw_overflow_abs (x) =
457
+ throw (OverflowError (LazyString (" checked arithmetic: cannot compute |x| for x = " , x, " ::" , typeof (x))))
458
+ else
459
+ @noinline _throw_overflow_abs (x) =
460
+ throw (OverflowError (" checked arithmetic: cannot compute |x| for x = $x " ))
455
461
end
456
462
457
463
# We introduce a new function for this since Base.Checked only supports integers, and ints
0 commit comments