Edit Clément qui nous fait des triplicata
Bonjour,
Ma fonction marque une erreur. Pourtant le code me parait bon. Voyez-vous une erreur?
Function inverse_mod(b As Long, n As Long)
Dim n0 As Long, b0 As Long, t0 As Long, t As Long, q As Long, r As Long, temp As Long
n0 = n
b0 = b
t0 = 0
t = 1
q = Fix(n0 / b0)
r = n0 - q * b0
Do While r > 0 temp = t0 - q * t If temp >= 0 Then temp = temp Mod n Else temp = n - ((-temp) Mod n)
t0 = t
t = temp
n0 = b0
b0 = r
q = Fix(n0 / b0)
r = n0 - q * b0 Loop
inverse_mod = t End Function
@ClementGirod merci de rester su ce fil SVP