Class NativeRealBig
java.lang.Object
java.lang.Number
org.episteme.core.mathematics.numbers.real.Real
org.episteme.nativ.mathematics.numbers.real.NativeRealBig
- All Implemented Interfaces:
Serializable, Comparable<Real>, AbelianGroup<Real>, AbelianMonoid<Real>, Group<Real>, Magma<Real>, Monoid<Real>, Field<Real>, FieldElement<Real>, Ring<Real>, RingElement<Real>, Semiring<Real>, Set<Real>
High-precision real number backed by the native MPFR library.
This implementation provides maximum performance by keeping data in native memory
and performing all operations via the Panama API.
- Since:
- 2.0
- Author:
- Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionNativeRealBig(String value, long precision) Creates a new NativeRealBig with the specified value and precision. -
Method Summary
Modifier and TypeMethodDescriptionabs()acos()Returns the arccosine of this number.acosh()Returns the inverse hyperbolic cosine of this number.Returns the sum of this element and another.asin()Returns the arcsine of this number.asinh()Returns the inverse hyperbolic sine of this number.atan()Returns the arctangent of this number.Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).atanh()Returns the inverse hyperbolic tangent of this number.cbrt()Returns the cube root of this number.ceil()Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer.intstatic NativeRealBigcopyFrom(MemorySegment sourcePtr, long precision) Efficiently creates a new NativeRealBig by copying from an existing native mpfr_t.cos()Returns the cosine of this number (in radians).cosh()Returns the hyperbolic cosine of this number.static NativeRealBigcreateEmpty(long precision) Creates a new NativeRealBig with specified precision, initialized to zero.Returns this element divided by another.doublebooleanexp()Returns e raised to this number.floor()Returns the largest (closest to positive infinity) double value that is less than or equal to the argument and is equal to a mathematical integer.getPtr()Public access to the underlying mpfr_t pointer for native backends.inthashCode()Returns sqrt(x^2 + y^2) without intermediate overflow or underflow.inverse()Returns the multiplicative inverse of this element.booleanbooleanisNaN()booleanisOne()Checks if this element is the multiplicative identity (one).booleanisZero()Checks if this element is the additive identity (zero).log()Returns the natural logarithm of this number.log10()Returns the base-10 logarithm of this number.Returns the product of this element and another.negate()Returns the additive inverse of this element.static NativeRealBigstatic NativeRealBigCreates a new NativeRealBig with specified value and precision.static NativeRealBigof(BigDecimal value) pow(double exponent) Returns this number raised to a power.pow(int exp) round()Returns the closest long to the argument, with ties rounding to positive infinity.sin()Returns the sine of this number (in radians).sinh()Returns the hyperbolic sine of this number.sqrt()Returns the difference of this element and another.tan()Returns the tangent of this number (in radians).tanh()Returns the hyperbolic tangent of this number.toString()Methods inherited from class Real
add, characteristic, contains, description, eE, floatValue, getScalarRing, halfPiE, intValue, inverse, isEmpty, isFast, isHighPrecision, isMultiplicationCommutative, isNegative, isPositive, ln10E, ln2E, longValue, max, min, mod, multiply, nanE, negate, negativeInfinityE, of, of, of, of, one, oneE, operate, piE, positiveInfinityE, remainder, ring, sign, toDegrees, toRadians, twoE, twoPiE, valueOf, zero, zeroEMethods inherited from class Number
byteValue, shortValueMethods inherited from interface AbelianGroup
isCommutative, subtractMethods inherited from interface AbelianMonoid
identity, isCommutativeMethods inherited from interface Monoid
isAssociative
-
Constructor Details
-
NativeRealBig
Creates a new NativeRealBig with the specified value and precision.
-
-
Method Details
-
of
-
createEmpty
Creates a new NativeRealBig with specified precision, initialized to zero. -
of
Creates a new NativeRealBig with specified value and precision. -
copyFrom
Efficiently creates a new NativeRealBig by copying from an existing native mpfr_t. -
of
-
getPtr
Public access to the underlying mpfr_t pointer for native backends. -
add
Description copied from interface:RingElementReturns the sum of this element and another.- Specified by:
addin interfaceRingElement<Real>- Specified by:
addin classReal- Parameters:
other- the element to add- Returns:
- this + other
-
subtract
Description copied from interface:RingElementReturns the difference of this element and another.Default implementation:
this.add(other.negate())- Specified by:
subtractin interfaceRingElement<Real>- Specified by:
subtractin classReal- Parameters:
other- the element to subtract- Returns:
- this - other
-
multiply
Description copied from interface:RingElementReturns the product of this element and another.- Specified by:
multiplyin interfaceRingElement<Real>- Specified by:
multiplyin classReal- Parameters:
other- the element to multiply- Returns:
- this * other
-
divide
Description copied from interface:FieldElementReturns this element divided by another.Default implementation:
this.multiply(other.inverse())- Specified by:
dividein interfaceFieldElement<Real>- Specified by:
dividein classReal- Parameters:
other- the divisor- Returns:
- this / other
-
negate
Description copied from interface:RingElementReturns the additive inverse of this element.- Specified by:
negatein interfaceRingElement<Real>- Specified by:
negatein classReal- Returns:
- -this
-
abs
-
inverse
Description copied from interface:FieldElementReturns the multiplicative inverse of this element.For any non-zero element e: e.multiply(e.inverse()) = e.one()
- Specified by:
inversein interfaceFieldElement<Real>- Specified by:
inversein classReal- Returns:
- 1/this
-
sqrt
-
pow
-
pow
-
isZero
public boolean isZero()Description copied from interface:RingElementChecks if this element is the additive identity (zero).- Specified by:
isZeroin interfaceRingElement<Real>- Specified by:
isZeroin classReal- Returns:
- true if this equals zero()
-
isOne
public boolean isOne()Description copied from interface:RingElementChecks if this element is the multiplicative identity (one).- Specified by:
isOnein interfaceRingElement<Real>- Specified by:
isOnein classReal- Returns:
- true if this equals one()
-
isNaN
-
isInfinite
public boolean isInfinite()- Specified by:
isInfinitein classReal
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classReal
-
bigDecimalValue
- Specified by:
bigDecimalValuein classReal
-
exp
-
log
-
log10
-
sin
-
cos
-
tan
-
asin
-
acos
-
atan
-
atan2
-
sinh
-
cosh
-
tanh
-
asinh
-
acosh
-
atanh
-
cbrt
-
hypot
-
pow
-
ceil
-
floor
-
round
-
compareTo
-
equals
-
hashCode
-
toString
-