public static long Align(long ptr, long length, int alignmentInBytes) { long offset = IntrinsicMath.Min(length, ComputeAlignmentOffset(ptr, alignmentInBytes)); return(ptr + offset); }
/// <summary> /// Computes min(first, second). /// </summary> /// <param name="first">The first argument.</param> /// <param name="second">The second argument.</param> /// <returns>The minimum of first and second value.</returns> public static Index3 Min(Index3 first, Index3 second) => new Index3( IntrinsicMath.Min(first.X, second.X), IntrinsicMath.Min(first.Y, second.Y), IntrinsicMath.Min(first.Z, second.Z));
/// <summary> /// Computes min(first, second). /// </summary> /// <param name="first">The first argument.</param> /// <param name="second">The second argument.</param> /// <returns>The minimum of first and second value.</returns> public static Index Min(Index first, Index second) => new Index(IntrinsicMath.Min(first.X, second.X));
/// <summary> /// Computes min(first, second). /// </summary> /// <param name="first">The first argument.</param> /// <param name="second">The second argument.</param> /// <returns>The minimum of first and second value.</returns> public static Index2 Min(Index2 first, Index2 second) => new Index2( IntrinsicMath.Min(first.X, second.X), IntrinsicMath.Min(first.Y, second.Y));
/// <summary> /// Computes min(first, second). /// </summary> /// <param name="first">The first argument.</param> /// <param name="second">The second argument.</param> /// <returns>The minimum of first and second value.</returns> public static Index1 Min(Index1 first, Index1 second) => new Index1(IntrinsicMath.Min(first.X, second.X));