Fan.Sys.Range.inclusive C# (CSharp) Method

inclusive() public method

public inclusive ( ) : bool
return bool
        public bool inclusive()
        {
            return !m_exclusive;
        }

Usage Example

Example #1
0
        public static long random(Range r)
        {
            rand.GetBytes(randBytes);
            long v = BitConverter.ToInt64(randBytes, 0);

            if (r == null)
            {
                return(v);
            }
            if (v < 0)
            {
                v = -v;
            }
            long start = r.start();
            long end   = r.end();

            if (r.inclusive())
            {
                ++end;
            }
            if (end <= start)
            {
                throw ArgErr.make("Range end < start: " + r).val;
            }
            return(start + (v % (end - start)));
        }
All Usage Examples Of Fan.Sys.Range::inclusive