salut il manque juste une petite fonction ExpoModGN
Version imprimable
salut il manque juste une petite fonction ExpoModGN
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 '--------------------------------------------------------------------------------------- Public Function ExpoModGN(ByVal GN As String, ByVal Expo As String, ByVal Modulo As String) As String '--------------------------------------------------------------------------------------- ' EXPONENTIATION MODULAIRE RAPIDE : GN^Expo MOD Modulo. '--------------------------------------------------------------------------------------- Dim x As String x = 1 While Expo > 0 If Right(Expo, 1) Mod 2 = 1 Then x = ModGN(PGN(GN, x), Modulo) GN = ModGN(PGN(GN, GN), Modulo) Expo = IntGN(PGN(Expo, "0.5")) Wend ExpoModGN = x End Function