Esempio n. 1
0
        static public double Factor(this UnitConstant me)
        {
            switch (me)
            {
            case UnitConstant.c:     return(1.0);    // constant ([#], 1) = dimentionless constant.

            case UnitConstant.tooth: return(1.0);    // constant ([tooth], 1) = named dimentionless constant.
            }
#if USE_LOG4NET
            log.Debug($"Constants: type not recognised: '(UnitConstant)0x{(ulong)me:x16}'");
#endif
            return(0.0);
        }
Esempio n. 2
0
        static public string Description(this UnitConstant me)
        {
            switch (me)
            {
            case UnitConstant.c:     return("constant: dimentionless constant, [#]");

            case UnitConstant.tooth: return("tooth: named dimentionless constant, [tooth]");
            }
            var msg = $"(UnitConstant)0x{(ulong)me:x16}";

#if USE_LOG4NET
            log.Debug($"Constant: type not recognised: '{msg}'");
#endif
            return($"Constant: dimentionless constant [{msg}]");
        }
Esempio n. 3
0
        static public string ToString(this UnitConstant me, bool append_brackets)
        {
            switch (me)
            {
            case UnitConstant.c:     return((append_brackets) ? "[#]" : "#");

            case UnitConstant.tooth: return((append_brackets) ? "[tooth]" : "tooth");
            }
            var msg = "(UnitConstant)0x{(ulong)me:x16}";

#if USE_LOG4NET
            log.Debug($"Constants: type not recognised: '{msg}'");
#endif
            return((append_brackets) ? $"[{msg}]" : msg);
        }
Esempio n. 4
0
 static public Unit Base(this UnitConstant me)
 {
     return(BASE);
 }