Rhino.ScriptRuntime.EqNumber C# (CSharp) Method

EqNumber() static private method

static private EqNumber ( double x, object y ) : bool
x double
y object
return bool
		internal static bool EqNumber(double x, object y)
		{
			for (; ; )
			{
				if (y == null || y == Undefined.instance)
				{
					return false;
				}
				else
				{
					if (y is Number)
					{
						return x == System.Convert.ToDouble(((Number)y));
					}
					else
					{
						if (y is CharSequence)
						{
							return x == ToNumber(y);
						}
						else
						{
							if (y is bool)
							{
								return x == (((bool)y) ? 1.0 : +0.0);
							}
							else
							{
								if (y is Scriptable)
								{
									if (y is ScriptableObject)
									{
										object xval = WrapNumber(x);
										object test = ((ScriptableObject)y).EquivalentValues(xval);
										if (test != ScriptableConstants.NOT_FOUND)
										{
											return ((bool)test);
										}
									}
									y = ToPrimitive(y);
								}
								else
								{
									WarnAboutNonJSObject(y);
									return false;
								}
							}
						}
					}
				}
			}
		}
ScriptRuntime