Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
Examples of errors detected by the...

Examples of errors detected by the V3040 diagnostic

V3040. The expression contains a suspicious mix of integer and real types.


QuantConnect Lean

V3040 The '10.25' literal of the 'double' type is compared to a value of the 'int' type. OpeningBreakoutAlgorithm.cs 426


public bool ShouldPlot
{
  get
  {
    ....
    if (Time.TimeOfDay.Hours < 10.25) return true;
    ....
  }
}

public struct TimeSpan : IComparable,
                         IComparable<TimeSpan>,
                         IEquatable<TimeSpan>,
                         IFormattable
{
  ....
  public double TotalHours { get; }
  public int Hours { get; }
  ....
}