Bonjour,

Je ne connais pas le C#, mais j'essai de retranscrire une class écrite en c# et j'aurais besoin d'aide.
je ne comprends pas comment passer l'argument "tolerance" avec cette "method":
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public static bool operator ==(Point3D left, Point3D right)
{
    return left.Equals(right);
}
[Pure]
public bool Equals(Point3D other, double tolerance)
{
    if (tolerance < 0)
     {
          throw new ArgumentException("epsilon < 0");
     }
 
      return Math.Abs(other.X - this.X) < tolerance &&
                   Math.Abs(other.Y - this.Y) < tolerance &&
                   Math.Abs(other.Z - this.Z) < tolerance;
}
Je ne comprends même pas comment cela peut fonctionner , parce que l'argument "tolerance" n'est pas optionnel, mais comme je connais pas le C#...
Pouvez vous m'éclairer svp

Merci