private void Show(R4 x) { if (R4.IsNaN(x)) { _wrt.Write("NA"); } else { _wrt.Write("{0:R}", x); } }
/// <summary> /// Returns whether the given object is non-null and an NA value for one of the standard types. /// </summary> public static bool IsNA(object v) { if (v == null) { return(false); } Type type = v.GetType(); if (type == typeof(R4)) { return(R4.IsNaN((R4)v)); } if (type == typeof(R8)) { return(R8.IsNaN((R8)v)); } Contracts.Assert(type == typeof(BL) || type == typeof(I4) || type == typeof(I8) || type == typeof(TX), "Unexpected constant value type!"); return(false); }
public static BL IsNA(R4 a) { return(R4.IsNaN(a)); }
public static bool IsNA(this R4 src) { return(R4.IsNaN(src)); }