private double ReadFloat() { MutableString value = ReadString(); if (value.Equals(_positiveInfinityString)) { return(Double.PositiveInfinity); } if (value.Equals(_negativeInfinityString)) { return(Double.NegativeInfinity); } if (value.Equals(_nanString)) { return(Double.NaN); } // TODO: MRI appears to have an optimization that saves the (binary) mantissa at the end of the string int pos = value.IndexOf((byte)0); if (pos >= 0) { value.Remove(pos, value.Length - pos); } return(Protocols.ConvertStringToFloat(Context, value)); }
public bool Equals(RubyRegex other) { return(ReferenceEquals(this, other) || other != null && _options.Equals(other._options) && _pattern.Equals(other._pattern)); }
public static bool StringEquals(string /*!*/ lhs, [NotNull] MutableString /*!*/ rhs) { // TODO: do not create MS return(rhs.Equals(MutableString.Create(lhs, RubyEncoding.UTF8))); }
public bool Equals(MutableString other) { return(other != null && _string.Equals(other)); }
public static bool Eql(string /*!*/ lhs, [NotNull] MutableString /*!*/ rhs) { return(rhs.Equals(lhs)); }