code: @SuppressWarnings("checkstyle:magicnumber")
      public static boolean equalLongAndDouble(long l, double d) {
          // see compareLongWithDouble for more details on what is going on here
  
          if (d > -0x1p53 && d < +0x1p53) {
              return equalDoubles((double) l, d);
          }
  
          if (d <= -0x1p63) {
              return false;
          }
  
          if (d >= +0x1p63) {
              return false;
          }
  
          if (Double.isNaN(d)) {
              return false;
          }
  
          return l == (long) d;
      }
docs: Checks the provided long and double values for equality.
  <p>
  The method fully avoids magnitude and precision losses while performing
  the equality check, e.g. {@code (double) Long.MAX_VALUE} is not equal to
  {@code Long.MAX_VALUE - 1}.
  
  @param l the long value to check the equality of.
  @param d the double value to check the equality of.
  @return {@code true} if the provided values are equal, {@code false}
  otherwise.