Class RealFloat
java.lang.Object
java.lang.Number
org.episteme.core.mathematics.numbers.real.Real
org.episteme.core.mathematics.numbers.real.RealFloat
- 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>
Real number backed by a 32-bit
float.
Package-private implementation detail.- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
Fields -
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.intReturns the characteristic of this field.intcos()Returns the cosine of this number (in radians).cosh()Returns the hyperbolic cosine of this number.static RealFloatcreate(float value) 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.inthashCode()Returns sqrt(x^2 + y^2) without intermediate overflow or underflow.inverse()Returns the multiplicative inverse of this element.booleanisFast()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.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.Converts an angle measured in radians to an approximately equivalent angle measured in degrees.Converts an angle measured in degrees to an approximately equivalent angle measured in radians.toString()Methods inherited from class Real
add, contains, description, eE, floatValue, getScalarRing, halfPiE, intValue, inverse, isEmpty, isHighPrecision, isMultiplicationCommutative, isNegative, isPositive, ln10E, ln2E, longValue, max, min, mod, multiply, nanE, negate, negativeInfinityE, of, of, of, of, of, of, one, oneE, operate, piE, positiveInfinityE, remainder, ring, sign, 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
-
Field Details
-
RING
-
-
Method Details
-
create
-
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
-
isFast
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classReal
-
bigDecimalValue
- Specified by:
bigDecimalValuein classReal
-
compareTo
-
equals
-
hashCode
-
toString
-
pow
-
exp
-
log
-
log10
-
sin
-
cos
-
tan
-
asin
-
acos
-
atan
-
atan2
-
sinh
-
cosh
-
tanh
-
asinh
-
acosh
-
atanh
-
cbrt
-
hypot
-
ceil
-
floor
-
round
-
toDegrees
-
toRadians
-
characteristic
public int characteristic()Description copied from interface:FieldReturns the characteristic of this field.The characteristic is the smallest positive integer n such that:
1 + 1 + ... + 1 (n times) = 0
If no such n exists, the characteristic is 0.Examples:
- char(ℚ) = char(â„Â) = char(â„‚) = 0
- char(ðÂâ€Â½Ã¢â€šÅ¡) = p (for prime p)
- Specified by:
characteristicin interfaceField<Real>- Overrides:
characteristicin classReal- Returns:
- the characteristic (0 for infinite fields, p for finite fields)
-