Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompareTo() [2/4]

int System.Single.CompareTo ( object? value)
inline

Implements System.IComparable< in T >.

Definition at line 150 of file Single.cs.

151 {
152 if (value == null)
153 {
154 return 1;
155 }
156 if (value is float num)
157 {
158 if (this < num)
159 {
160 return -1;
161 }
162 if (this > num)
163 {
164 return 1;
165 }
166 if (this == num)
167 {
168 return 0;
169 }
170 if (IsNaN(this))
171 {
172 if (!IsNaN(num))
173 {
174 return -1;
175 }
176 return 0;
177 }
178 return 1;
179 }
180 throw new ArgumentException(SR.Arg_MustBeSingle);
181 }
static bool IsNaN(float f)
Definition Single.cs:90

References System.SR.Arg_MustBeSingle, System.Single.IsNaN(), and System.value.