public static LessThanOrClose ( double value1, double value2 ) : bool | ||
value1 | double | The first double to compare. |
value2 | double | The second double to compare. |
return | bool |
public static bool IsBetweenZeroAndOne(double val) { if (DoubleUtil.GreaterThanOrClose(val, 0.0)) { return(DoubleUtil.LessThanOrClose(val, 1.0)); } return(false); }
/// <summary> /// Creates an instances of <see cref="DpiScale2"/> from PPI values. /// </summary> /// <param name="ppiX">PPI along X-axis</param> /// <param name="ppiY">PPI along Y-axis</param> /// <returns>A new <see cref="DpiScale2"/> instance</returns> internal static DpiScale2 FromPixelsPerInch(double ppiX, double ppiY) { if (DoubleUtil.LessThanOrClose(ppiX, 0) || DoubleUtil.LessThanOrClose(ppiY, 0)) { return(null); } return(new DpiScale2(ppiX / DpiUtil.DefaultPixelsPerInch, ppiY / DpiUtil.DefaultPixelsPerInch)); }