Struct DomainRange
- Namespace
- xFunc.Maths.Expressions.Domains
- Assembly
- xFunc.Maths.dll
Represents a range of allowed values for the domain of function.
public readonly struct DomainRange : IEquatable<DomainRange>
- Implements
- Inherited Members
Constructors
DomainRange(NumberValue, bool, NumberValue, bool)
Initializes a new instance of the DomainRange struct.
public DomainRange(NumberValue start, bool isStartInclusive, NumberValue end, bool isEndInclusive)
Parameters
start
NumberValueThe start of the range.
isStartInclusive
boolDetermines whether the
start
parameter is inclusive.end
NumberValueThe end of the range.
isEndInclusive
boolDetermines whether the
end
parameter is inclusive.
Properties
End
Gets the end of the range.
public NumberValue End { get; }
Property Value
IsEndInclusive
Gets a value indicating whether the end is inclusive.
public bool IsEndInclusive { get; }
Property Value
IsStartInclusive
Gets a value indicating whether the start is inclusive.
public bool IsStartInclusive { get; }
Property Value
Start
Gets the start of the range.
public NumberValue Start { get; }
Property Value
Methods
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
Equals(DomainRange)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(DomainRange other)
Parameters
other
DomainRangeAn object to compare with this object.
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
IsInRange(NumberValue)
Determines whether the value
number is in the range of domain.
public bool IsInRange(NumberValue value)
Parameters
value
NumberValueThe number.
Returns
- bool
true
, if thevalue
number is in the range of domain, otherwise,false
.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(DomainRange, DomainRange)
Indicates whether left
range is equal to the right
range.
public static bool operator ==(DomainRange left, DomainRange right)
Parameters
left
DomainRangeThe left range.
right
DomainRangeThe right range.
Returns
- bool
true
if theleft
range is equal to theright
range; otherwise,false
.
operator !=(DomainRange, DomainRange)
Indicates whether left
range is not equal to the right
range.
public static bool operator !=(DomainRange left, DomainRange right)
Parameters
left
DomainRangeThe left range.
right
DomainRangeThe right range.
Returns
- bool
true
if theleft
range is not equal to theright
range; otherwise,false
.