Boo.Lang.Compiler.Steps.EmitAssembly.EmitLoadLiteral C# (CSharp) Метод

EmitLoadLiteral() приватный Метод

private EmitLoadLiteral ( IType type, double d ) : void
type IType
d double
Результат void
        void EmitLoadLiteral(IType type, double d)
        {
            if (type == TypeSystemServices.SingleType)
            {
                if (d != 0)
                    _il.Emit(OpCodes.Ldc_R4, (float) d);
                else
                {
                    _il.Emit(OpCodes.Ldc_I4_0);
                    _il.Emit(OpCodes.Conv_R4);
                }
                return;
            }

            if (type == TypeSystemServices.DoubleType)
            {
                if (d != 0)
                    _il.Emit(OpCodes.Ldc_R8, d);
                else
                {
                    _il.Emit(OpCodes.Ldc_I4_0);
                    _il.Emit(OpCodes.Conv_R8);
                }
                return;
            }

            throw new InvalidOperationException(string.Format("`{0}' is not a literal", type));
        }

Same methods

EmitAssembly::EmitLoadLiteral ( IType type, long l ) : void
EmitAssembly::EmitLoadLiteral ( int i ) : void
EmitAssembly::EmitLoadLiteral ( long l ) : void
EmitAssembly