Esempio n. 1
0
 Object unpack(ByteStream buf) {
   long bits = (((long) BEreadInt(buf)) << 32) + (BEreadInt(buf) & 0xFFFFFFFFL);
   double v = Double.longBitsToDouble(bits);
   if (PyFloat.double_format == PyFloat.Format.UNKNOWN
       && (Double.isInfinite(v) || Double.isNaN(v))) {
     throw Py.ValueError("can't unpack IEEE 754 special value on non-IEEE platform");
   }
   return Py.newFloat(v);
 }
Esempio n. 2
0
 Object unpack(ByteStream buf) {
   int bits = BEreadInt(buf);
   float v = Float.intBitsToFloat(bits);
   if (PyFloat.float_format == PyFloat.Format.UNKNOWN
       && (Float.isInfinite(v) || Float.isNaN(v))) {
     throw Py.ValueError("can't unpack IEEE 754 special value on non-IEEE platform");
   }
   return Py.newFloat(v);
 }
Esempio n. 3
0
 Object makeFloat(Token t) {
   return Py.newFloat(Double.valueOf(t.getText()));
 }
 public final PyObject invoke(PyObject[] args) {
   return Py.newFloat(jffiInvoker.invokeDouble(jffiFunction, convertArguments(args)));
 }