@@ -183,7 +183,7 @@ julia> gcdx(240, 46)
183183 their `typemax`, and the identity then holds only via the unsigned
184184 integers' modulo arithmetic.
185185"""
186- function gcdx (a:: Integer , b:: Integer )
186+ Base . @assume_effects :terminates_locally function gcdx (a:: Integer , b:: Integer )
187187 T = promote_type (typeof (a), typeof (b))
188188 # a0, b0 = a, b
189189 s0, s1 = oneunit (T), zero (T)
@@ -233,7 +233,7 @@ function invmod(n::Integer, m::Integer)
233233 n == typeof (n)(- 1 ) && m == typemin (typeof (n)) && return T (- 1 )
234234 end
235235 g, x, y = gcdx (n, m)
236- g != 1 && throw (DomainError ((n, m), " Greatest common divisor is $g . " ))
236+ g != 1 && throw (DomainError ((n, m), LazyString ( " Greatest common divisor is " , g, " . " ) ))
237237 # Note that m might be negative here.
238238 if n isa Unsigned && hastypemax (typeof (n)) && x > typemax (n)>> 1
239239 # x might have wrapped if it would have been negative
@@ -1057,7 +1057,7 @@ julia> binomial(-5, 3)
10571057# External links
10581058* [Binomial coefficient](https://en.wikipedia.org/wiki/Binomial_coefficient) on Wikipedia.
10591059"""
1060- function binomial (n:: T , k:: T ) where T<: Integer
1060+ Base . @assume_effects :terminates_locally function binomial (n:: T , k:: T ) where T<: Integer
10611061 n0, k0 = n, k
10621062 k < 0 && return zero (T)
10631063 sgn = one (T)
@@ -1079,7 +1079,7 @@ function binomial(n::T, k::T) where T<:Integer
10791079 while rr <= k
10801080 xt = div (widemul (x, nn), rr)
10811081 x = xt % T
1082- x == xt || throw (OverflowError (" binomial($ n0 , $k0 ) overflows" ))
1082+ x == xt || throw (OverflowError (LazyString ( " binomial(" , n0, " , " , k0, " overflows" ) ))
10831083 rr += one (T)
10841084 nn += one (T)
10851085 end
0 commit comments