summaryrefslogtreecommitdiff
path: root/libjava/java/math
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/math')
-rw-r--r--libjava/java/math/BigDecimal.h126
-rw-r--r--libjava/java/math/BigInteger.h211
-rw-r--r--libjava/java/math/MathContext.h46
-rw-r--r--libjava/java/math/RoundingMode.h46
4 files changed, 429 insertions, 0 deletions
diff --git a/libjava/java/math/BigDecimal.h b/libjava/java/math/BigDecimal.h
new file mode 100644
index 000000000..aeeab2523
--- /dev/null
+++ b/libjava/java/math/BigDecimal.h
@@ -0,0 +1,126 @@
+
+// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
+
+#ifndef __java_math_BigDecimal__
+#define __java_math_BigDecimal__
+
+#pragma interface
+
+#include <java/lang/Number.h>
+#include <gcj/array.h>
+
+extern "Java"
+{
+ namespace java
+ {
+ namespace math
+ {
+ class BigDecimal;
+ class BigInteger;
+ class MathContext;
+ class RoundingMode;
+ }
+ }
+}
+
+class java::math::BigDecimal : public ::java::lang::Number
+{
+
+public:
+ BigDecimal(jint);
+ BigDecimal(jint, ::java::math::MathContext *);
+ BigDecimal(jlong);
+ BigDecimal(jlong, ::java::math::MathContext *);
+ BigDecimal(::java::math::BigInteger *, ::java::math::MathContext *);
+ BigDecimal(::java::lang::String *, ::java::math::MathContext *);
+ BigDecimal(::java::math::BigInteger *);
+ BigDecimal(::java::math::BigInteger *, jint);
+ BigDecimal(::java::math::BigInteger *, jint, ::java::math::MathContext *);
+ BigDecimal(jdouble, ::java::math::MathContext *);
+ BigDecimal(jdouble);
+ BigDecimal(JArray< jchar > *, jint, jint, ::java::math::MathContext *);
+ BigDecimal(JArray< jchar > *, ::java::math::MathContext *);
+ BigDecimal(JArray< jchar > *);
+ BigDecimal(JArray< jchar > *, jint, jint);
+ BigDecimal(::java::lang::String *);
+ static ::java::math::BigDecimal * valueOf(jlong);
+ static ::java::math::BigDecimal * valueOf(jlong, jint);
+ virtual ::java::math::BigDecimal * add(::java::math::BigDecimal *);
+ virtual ::java::math::BigDecimal * add(::java::math::BigDecimal *, ::java::math::MathContext *);
+ virtual ::java::math::BigDecimal * subtract(::java::math::BigDecimal *);
+ virtual ::java::math::BigDecimal * subtract(::java::math::BigDecimal *, ::java::math::MathContext *);
+ virtual ::java::math::BigDecimal * multiply(::java::math::BigDecimal *);
+ virtual ::java::math::BigDecimal * multiply(::java::math::BigDecimal *, ::java::math::MathContext *);
+ virtual ::java::math::BigDecimal * divide(::java::math::BigDecimal *, jint);
+ virtual ::java::math::BigDecimal * divide(::java::math::BigDecimal *, jint, ::java::math::RoundingMode *);
+ virtual ::java::math::BigDecimal * divide(::java::math::BigDecimal *, ::java::math::RoundingMode *);
+ virtual ::java::math::BigDecimal * divide(::java::math::BigDecimal *, jint, jint);
+ virtual ::java::math::BigDecimal * divide(::java::math::BigDecimal *);
+ virtual ::java::math::BigDecimal * remainder(::java::math::BigDecimal *);
+ virtual JArray< ::java::math::BigDecimal * > * divideAndRemainder(::java::math::BigDecimal *);
+ virtual ::java::math::BigDecimal * divideToIntegralValue(::java::math::BigDecimal *);
+private:
+ ::java::math::BigDecimal * floor();
+public:
+ virtual jint BigDecimal$compareTo(::java::math::BigDecimal *);
+ virtual jboolean equals(::java::lang::Object *);
+ virtual jint hashCode();
+ virtual ::java::math::BigDecimal * max(::java::math::BigDecimal *);
+ virtual ::java::math::BigDecimal * min(::java::math::BigDecimal *);
+ virtual ::java::math::BigDecimal * movePointLeft(jint);
+ virtual ::java::math::BigDecimal * movePointRight(jint);
+ virtual jint signum();
+ virtual jint scale();
+ virtual ::java::math::BigInteger * unscaledValue();
+ virtual ::java::math::BigDecimal * abs();
+ virtual ::java::math::BigDecimal * negate();
+ virtual ::java::math::BigDecimal * negate(::java::math::MathContext *);
+ virtual ::java::math::BigDecimal * plus();
+ virtual ::java::math::BigDecimal * plus(::java::math::MathContext *);
+ virtual ::java::math::BigDecimal * round(::java::math::MathContext *);
+ virtual jint precision();
+ virtual ::java::lang::String * toString();
+ virtual ::java::lang::String * toEngineeringString();
+ virtual ::java::lang::String * toPlainString();
+ virtual ::java::math::BigInteger * toBigInteger();
+ virtual ::java::math::BigInteger * toBigIntegerExact();
+ virtual jint intValue();
+ virtual ::java::math::BigDecimal * stripTrailingZeros();
+ virtual jlong longValue();
+ virtual jfloat floatValue();
+ virtual jdouble doubleValue();
+ virtual ::java::math::BigDecimal * setScale(jint);
+ virtual ::java::math::BigDecimal * setScale(jint, jint);
+ virtual ::java::math::BigDecimal * setScale(jint, ::java::math::RoundingMode *);
+ static ::java::math::BigDecimal * valueOf(jdouble);
+ virtual ::java::math::BigDecimal * scaleByPowerOfTen(jint);
+ virtual ::java::math::BigDecimal * pow(jint);
+ virtual ::java::math::BigDecimal * pow(jint, ::java::math::MathContext *);
+ virtual ::java::math::BigDecimal * abs(::java::math::MathContext *);
+ virtual ::java::math::BigDecimal * ulp();
+ virtual jlong longValueExact();
+ virtual jint intValueExact();
+ virtual jbyte byteValueExact();
+ virtual jshort shortValueExact();
+ virtual jint compareTo(::java::lang::Object *);
+private:
+ ::java::math::BigInteger * __attribute__((aligned(__alignof__( ::java::lang::Number)))) intVal;
+ jint scale__;
+ jint precision__;
+ static const jlong serialVersionUID = 6108874887143696463LL;
+public:
+ static ::java::math::BigDecimal * ZERO;
+ static ::java::math::BigDecimal * ONE;
+ static ::java::math::BigDecimal * TEN;
+ static const jint ROUND_UP = 0;
+ static const jint ROUND_DOWN = 1;
+ static const jint ROUND_CEILING = 2;
+ static const jint ROUND_FLOOR = 3;
+ static const jint ROUND_HALF_UP = 4;
+ static const jint ROUND_HALF_DOWN = 5;
+ static const jint ROUND_HALF_EVEN = 6;
+ static const jint ROUND_UNNECESSARY = 7;
+ static ::java::lang::Class class$;
+};
+
+#endif // __java_math_BigDecimal__
diff --git a/libjava/java/math/BigInteger.h b/libjava/java/math/BigInteger.h
new file mode 100644
index 000000000..a3ace698a
--- /dev/null
+++ b/libjava/java/math/BigInteger.h
@@ -0,0 +1,211 @@
+
+// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
+
+#ifndef __java_math_BigInteger__
+#define __java_math_BigInteger__
+
+#pragma interface
+
+#include <java/lang/Number.h>
+#include <gcj/array.h>
+
+extern "Java"
+{
+ namespace gnu
+ {
+ namespace java
+ {
+ namespace lang
+ {
+ class CPStringBuilder;
+ }
+ namespace math
+ {
+ class GMP;
+ }
+ }
+ }
+ namespace java
+ {
+ namespace math
+ {
+ class BigInteger;
+ }
+ }
+}
+
+class java::math::BigInteger : public ::java::lang::Number
+{
+
+ BigInteger();
+ BigInteger(jint);
+public:
+ BigInteger(::java::lang::String *, jint);
+ BigInteger(::java::lang::String *);
+ BigInteger(JArray< jbyte > *);
+ BigInteger(jint, JArray< jbyte > *);
+ BigInteger(jint, ::java::util::Random *);
+private:
+ void init(jint, ::java::util::Random *);
+public:
+ BigInteger(jint, jint, ::java::util::Random *);
+ static ::java::math::BigInteger * probablePrime(jint, ::java::util::Random *);
+ static ::java::math::BigInteger * valueOf(jlong);
+private:
+ static jboolean initializeLibrary();
+ static ::java::math::BigInteger * make(JArray< jint > *, jint);
+ static JArray< jint > * byteArrayToIntArray(JArray< jbyte > *, jint);
+ static ::java::math::BigInteger * alloc(jint);
+ void realloc(jint);
+ jboolean isNegative();
+public:
+ virtual jint signum();
+private:
+ static jint compareTo(::java::math::BigInteger *, ::java::math::BigInteger *);
+public:
+ virtual jint BigInteger$compareTo(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * min(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * max(::java::math::BigInteger *);
+private:
+ jboolean isZero();
+ jboolean isOne();
+ static jint wordsNeeded(JArray< jint > *, jint);
+ ::java::math::BigInteger * canonicalize();
+ static ::java::math::BigInteger * add(jint, jint);
+ static ::java::math::BigInteger * add(::java::math::BigInteger *, jint);
+ void setAdd(::java::math::BigInteger *, jint);
+ void setAdd(jint);
+ void set(jlong);
+ void set(JArray< jint > *, jint);
+ void set(::java::math::BigInteger *);
+ static ::java::math::BigInteger * add(::java::math::BigInteger *, ::java::math::BigInteger *, jint);
+public:
+ virtual ::java::math::BigInteger * add(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * subtract(::java::math::BigInteger *);
+private:
+ static ::java::math::BigInteger * times(::java::math::BigInteger *, jint);
+ static ::java::math::BigInteger * times(::java::math::BigInteger *, ::java::math::BigInteger *);
+public:
+ virtual ::java::math::BigInteger * multiply(::java::math::BigInteger *);
+private:
+ static void divide(jlong, jlong, ::java::math::BigInteger *, ::java::math::BigInteger *, jint);
+ static void divide(::java::math::BigInteger *, ::java::math::BigInteger *, ::java::math::BigInteger *, ::java::math::BigInteger *, jint);
+public:
+ virtual ::java::math::BigInteger * divide(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * remainder(::java::math::BigInteger *);
+ virtual JArray< ::java::math::BigInteger * > * divideAndRemainder(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * mod(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * pow(jint);
+private:
+ static JArray< jint > * euclidInv(jint, jint, jint);
+ static void euclidInv(::java::math::BigInteger *, ::java::math::BigInteger *, ::java::math::BigInteger *, JArray< ::java::math::BigInteger * > *);
+public:
+ virtual ::java::math::BigInteger * modInverse(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * modPow(::java::math::BigInteger *, ::java::math::BigInteger *);
+private:
+ static jint gcd(jint, jint);
+public:
+ virtual ::java::math::BigInteger * gcd(::java::math::BigInteger *);
+ virtual jboolean isProbablePrime(jint);
+private:
+ void setInvert();
+ void setShiftLeft(::java::math::BigInteger *, jint);
+ void setShiftRight(::java::math::BigInteger *, jint);
+ void setShift(::java::math::BigInteger *, jint);
+ static ::java::math::BigInteger * shift(::java::math::BigInteger *, jint);
+public:
+ virtual ::java::math::BigInteger * shiftLeft(jint);
+ virtual ::java::math::BigInteger * shiftRight(jint);
+private:
+ void format(jint, ::gnu::java::lang::CPStringBuilder *);
+public:
+ virtual ::java::lang::String * toString();
+ virtual ::java::lang::String * toString(jint);
+ virtual jint intValue();
+ virtual jlong longValue();
+ virtual jint hashCode();
+private:
+ static jboolean equals(::java::math::BigInteger *, ::java::math::BigInteger *);
+public:
+ virtual jboolean equals(::java::lang::Object *);
+private:
+ static ::java::math::BigInteger * valueOf(JArray< jbyte > *, jint, jboolean, jint);
+public:
+ virtual jdouble doubleValue();
+ virtual jfloat floatValue();
+private:
+ jboolean checkBits(jint);
+ jdouble roundToDouble(jint, jboolean, jboolean);
+ void getAbsolute(JArray< jint > *);
+ static jboolean negate(JArray< jint > *, JArray< jint > *, jint);
+ void setNegative(::java::math::BigInteger *);
+ void setNegative();
+ static ::java::math::BigInteger * abs(::java::math::BigInteger *);
+public:
+ virtual ::java::math::BigInteger * abs();
+private:
+ static ::java::math::BigInteger * neg(::java::math::BigInteger *);
+public:
+ virtual ::java::math::BigInteger * negate();
+ virtual jint bitLength();
+ virtual JArray< jbyte > * toByteArray();
+private:
+ static jint swappedOp(jint);
+ static ::java::math::BigInteger * bitOp(jint, ::java::math::BigInteger *, ::java::math::BigInteger *);
+ static void setBitOp(::java::math::BigInteger *, jint, ::java::math::BigInteger *, ::java::math::BigInteger *);
+ static ::java::math::BigInteger * and$(::java::math::BigInteger *, jint);
+public:
+ virtual ::java::math::BigInteger * and$(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * or$(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * xor$(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * not$();
+ virtual ::java::math::BigInteger * andNot(::java::math::BigInteger *);
+ virtual ::java::math::BigInteger * clearBit(jint);
+ virtual ::java::math::BigInteger * setBit(jint);
+ virtual jboolean testBit(jint);
+ virtual ::java::math::BigInteger * flipBit(jint);
+ virtual jint getLowestSetBit();
+private:
+ static jint bitCount(jint);
+ static jint bitCount(JArray< jint > *, jint);
+public:
+ virtual jint bitCount();
+private:
+ void readObject(::java::io::ObjectInputStream *);
+ void writeObject(::java::io::ObjectOutputStream *);
+public:
+ virtual jint compareTo(::java::lang::Object *);
+private:
+ static ::java::util::logging::Logger * log;
+ jint __attribute__((aligned(__alignof__( ::java::lang::Number)))) ival;
+ JArray< jint > * words;
+ jint bitCount__;
+ jint bitLength__;
+ jint lowestSetBit;
+ JArray< jbyte > * magnitude;
+ jint signum__;
+ static const jlong serialVersionUID = -8287574255936472291LL;
+ static const jint minFixNum = -100;
+ static const jint maxFixNum = 1024;
+ static const jint numFixNum = 1125;
+ static JArray< ::java::math::BigInteger * > * smallFixNums;
+ ::gnu::java::math::GMP * mpz;
+ static jboolean USING_NATIVE;
+public:
+ static ::java::math::BigInteger * ZERO;
+ static ::java::math::BigInteger * ONE;
+ static ::java::math::BigInteger * TEN;
+private:
+ static const jint FLOOR = 1;
+ static const jint CEILING = 2;
+ static const jint TRUNCATE = 3;
+ static const jint ROUND = 4;
+ static JArray< jint > * primes;
+ static JArray< jint > * k;
+ static JArray< jint > * t;
+ static JArray< jbyte > * bit4_count;
+public:
+ static ::java::lang::Class class$;
+};
+
+#endif // __java_math_BigInteger__
diff --git a/libjava/java/math/MathContext.h b/libjava/java/math/MathContext.h
new file mode 100644
index 000000000..bed83920b
--- /dev/null
+++ b/libjava/java/math/MathContext.h
@@ -0,0 +1,46 @@
+
+// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
+
+#ifndef __java_math_MathContext__
+#define __java_math_MathContext__
+
+#pragma interface
+
+#include <java/lang/Object.h>
+extern "Java"
+{
+ namespace java
+ {
+ namespace math
+ {
+ class MathContext;
+ class RoundingMode;
+ }
+ }
+}
+
+class java::math::MathContext : public ::java::lang::Object
+{
+
+public:
+ MathContext(jint);
+ MathContext(jint, ::java::math::RoundingMode *);
+ MathContext(::java::lang::String *);
+ jboolean equals(::java::lang::Object *);
+ jint getPrecision();
+ ::java::math::RoundingMode * getRoundingMode();
+ ::java::lang::String * toString();
+ jint hashCode();
+ static ::java::math::MathContext * UNLIMITED;
+ static ::java::math::MathContext * DECIMAL32;
+ static ::java::math::MathContext * DECIMAL64;
+ static ::java::math::MathContext * DECIMAL128;
+private:
+ static const jlong serialVersionUID = 5579720004786848255LL;
+ jint __attribute__((aligned(__alignof__( ::java::lang::Object)))) precision;
+ ::java::math::RoundingMode * roundMode;
+public:
+ static ::java::lang::Class class$;
+};
+
+#endif // __java_math_MathContext__
diff --git a/libjava/java/math/RoundingMode.h b/libjava/java/math/RoundingMode.h
new file mode 100644
index 000000000..b72f7cff7
--- /dev/null
+++ b/libjava/java/math/RoundingMode.h
@@ -0,0 +1,46 @@
+
+// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
+
+#ifndef __java_math_RoundingMode__
+#define __java_math_RoundingMode__
+
+#pragma interface
+
+#include <java/lang/Enum.h>
+#include <gcj/array.h>
+
+extern "Java"
+{
+ namespace java
+ {
+ namespace math
+ {
+ class RoundingMode;
+ }
+ }
+}
+
+class java::math::RoundingMode : public ::java::lang::Enum
+{
+
+ RoundingMode(::java::lang::String *, jint);
+public:
+ static ::java::math::RoundingMode * valueOf(jint);
+ static JArray< ::java::math::RoundingMode * > * values();
+ static ::java::math::RoundingMode * valueOf(::java::lang::String *);
+ static ::java::math::RoundingMode * UP;
+ static ::java::math::RoundingMode * DOWN;
+ static ::java::math::RoundingMode * CEILING;
+ static ::java::math::RoundingMode * FLOOR;
+ static ::java::math::RoundingMode * HALF_UP;
+ static ::java::math::RoundingMode * HALF_DOWN;
+ static ::java::math::RoundingMode * HALF_EVEN;
+ static ::java::math::RoundingMode * UNNECESSARY;
+private:
+ static const jlong serialVersionUID = 432302042773881265LL;
+ static JArray< ::java::math::RoundingMode * > * ENUM$VALUES;
+public:
+ static ::java::lang::Class class$;
+};
+
+#endif // __java_math_RoundingMode__