Exemplo n.º 1
0
 public static RubyFloat unmarshalFrom(UnmarshalStream input) throws java.io.IOException {
   ByteList value = input.unmarshalString();
   RubyFloat result;
   if (value.equals(NAN_BYTELIST)) {
     result = RubyFloat.newFloat(input.getRuntime(), RubyFloat.NAN);
   } else if (value.equals(NEGATIVE_INFINITY_BYTELIST)) {
     result = RubyFloat.newFloat(input.getRuntime(), Double.NEGATIVE_INFINITY);
   } else if (value.equals(INFINITY_BYTELIST)) {
     result = RubyFloat.newFloat(input.getRuntime(), Double.POSITIVE_INFINITY);
   } else {
     result = RubyFloat.newFloat(input.getRuntime(), ConvertDouble.byteListToDouble(value, false));
   }
   input.registerLinkTarget(result);
   return result;
 }
Exemplo n.º 2
0
 public double yield(RubyString arg, boolean strict) {
   return ConvertDouble.byteListToDouble19(arg.getByteList(), strict);
 }