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
startNumberValueThe start of the range.
isStartInclusiveboolDetermines whether the
startparameter is inclusive.endNumberValueThe end of the range.
isEndInclusiveboolDetermines whether the
endparameter 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
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
otherDomainRangeAn object to compare with this object.
Returns
GetHashCode()
Returns the hash code for this instance.
[ExcludeFromCodeCoverage]
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
valueNumberValueThe number.
Returns
- bool
true, if thevaluenumber 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
leftDomainRangeThe left range.
rightDomainRangeThe right range.
Returns
- bool
trueif theleftrange is equal to therightrange; 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
leftDomainRangeThe left range.
rightDomainRangeThe right range.
Returns
- bool
trueif theleftrange is not equal to therightrange; otherwise,false.