Examples of PyFloat


Examples of org.python.core.PyFloat

                        int v = Integer.parseInt(value);
                        pyValue = new PyInteger(v);
                    } catch (NumberFormatException e) {
                        try {
                            double v = Double.parseDouble(value);
                            pyValue = new PyFloat(v);
                        } catch (NumberFormatException e1) {
                            pyValue = new PyString(value);
                        }
                    }
                }
View Full Code Here

Examples of org.python.core.PyFloat

      value = column.getDouble();
    } else {
      throw new IllegalArgumentException("Column is not a float/double, is " +
          column.hiveType());
    }
    return new PyFloat(value);
  }
View Full Code Here

Examples of org.python.core.PyFloat

        public NumberToPyFloat(Class c) {
            super(c);
        }

        public PyObject adapt(Object o) {
            return new PyFloat(((Number) o).doubleValue());
        }
View Full Code Here

Examples of org.python.core.PyFloat

                return read_binint();
        }

        final private void load_float() {
            String line = file.readlineNoNl();
            push(new PyFloat(Double.valueOf(line).doubleValue()));
        }
View Full Code Here

Examples of org.python.core.PyFloat

                        ((long)s.charAt(4) << 24) |
                        ((long)s.charAt(3) << 32) |
                        ((long)s.charAt(2) << 40) |
                        ((long)s.charAt(1) << 48) |
                        ((long)s.charAt(0) << 56);
            push(new PyFloat(Double.longBitsToDouble(bits)));
        }
View Full Code Here

Examples of org.python.core.PyFloat

    }

    public static PyTuple modf(double v) {
        double w = v % 1.0;
        v -= w;
        return new PyTuple(new PyFloat(w), new PyFloat(v));
    }
View Full Code Here

Examples of org.python.core.PyFloat

            for (; x >= 1.0; x *= 0.5, exponent++);

            x *= sign;
        }
        return new PyTuple(new PyFloat(x), new PyInteger(exponent));
    }
View Full Code Here

Examples of org.python.core.PyFloat

    public static PyComplex log10(PyObject in) {
        PyComplex r = new PyComplex(0.0, 0.0);
        PyComplex x = complexFromPyObject(in);
        double l = hypot(x.real, x.imag);
        r.imag = Math.atan2(x.imag, x.real) / Math.log(10.0);
        r.real = math.log10(new PyFloat(l));
        return (r);
    }
View Full Code Here

Examples of org.python.core.PyFloat

    public static PyComplex log(PyComplex x, double base) {
        PyComplex r = new PyComplex(0.0, 0.0);
        double l = hypot(x.real, x.imag);
        double log_base = Math.log(base);
        r.imag = Math.atan2(x.imag, x.real) / log_base;
        r.real = math.log(new PyFloat(l)) / log_base;
        return (r);
    }
View Full Code Here

Examples of org.python.core.PyFloat

                    return num;
                }
            } else if (num.getInternalN() instanceof PyFloat) {
                double v = ((PyFloat)num.getInternalN()).getValue();
                if (v >= 0) {
                    num.setN(new PyFloat(-v));
                    return num;
                }
            } else if (num.getInternalN() instanceof PyComplex) {
                double v = ((PyComplex)num.getInternalN()).imag;
                if (v >= 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.