IronRuby.Builtins.Comparable.GreaterOrEqual C# (CSharp) Method

GreaterOrEqual() private method

private GreaterOrEqual ( BinaryOpStorage compareStorage, BinaryOpStorage lessThanStorage, BinaryOpStorage greaterThanStorage, object self, object other ) : bool
compareStorage BinaryOpStorage
lessThanStorage BinaryOpStorage
greaterThanStorage BinaryOpStorage
self object
other object
return bool
        public static bool GreaterOrEqual(
            BinaryOpStorage/*!*/ compareStorage,
            BinaryOpStorage/*!*/ lessThanStorage,
            BinaryOpStorage/*!*/ greaterThanStorage,
            object self, object other) {

            return Compare(compareStorage, lessThanStorage, greaterThanStorage, self, other).GetValueOrDefault(-1) >= 0;
        }

Usage Example

Example #1
0
        private void AppendInt(char format)
        {
            object val = Protocols.ConvertToInteger(_context, _opts.Value);

            bool isPositive = Comparable.GreaterOrEqual(_context, val, 0);

            if (_opts.LeftAdj)
            {
                AppendLeftAdj(val, isPositive, 'D');
            }
            else if (_opts.ZeroPad)
            {
                AppendZeroPad(val, isPositive, 'D');
            }
            else
            {
                AppendNumeric(val, isPositive, 'D', format == 'u');
            }
        }