Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Icod.Collections.Immutable.IStack<Type> Add( Icod.Collections.Immutable.IStack<Type> stack ) {
- var a = stack.Peek();
- stack = stack.Pop();
- var b = stack.Peek();
- stack = stack.Pop();
- var q = ( ( a.Value is System.Decimal ) || ( b.Value is System.Decimal ) )
- ? Type.CreateDecimal( System.Convert.ToDecimal( b.Value ) + System.Convert.ToDecimal( a.Value ) )
- : ( ( a.Value is System.Single ) || ( b.Value is System.Single ) )
- ? Type.CreateSingle( System.Convert.ToSingle( b.Value ) + System.Convert.ToSingle( a.Value ) )
- : Type.CreateInt( System.Convert.ToInt32( b.Value ) + System.Convert.ToInt32( a.Value ) )
- ;
- stack = stack.Push( q );
- return stack;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement