Documentation
¶
Overview ¶
Package math exposes JVM-faithful java.lang.Math equivalents for code running on glojure. Each symbol is published two ways:
- as a Go package-level value (used when gloat AOT-compiles a Clojure call site to a direct Go reference such as `compatmath.Sqrt`); and
- through glojure's pkgmap (used by the REPL and any dynamic resolution path).
Java's Math methods are overloaded by argument type (int, long, float, double). The polymorphic helpers here type-switch on the runtime argument and dispatch to the matching gojava overload, returning a Go value whose type mirrors what the JVM would have produced for the same call.
Index ¶
- Variables
- func Abs(x any) any
- func AddExact(a, b any) any
- func DecrementExact(x any) any
- func FloorDiv(a, b any) any
- func FloorMod(a, b any) any
- func IncrementExact(x any) any
- func Max(a, b any) any
- func Min(a, b any) any
- func MultiplyExact(a, b any) any
- func NegateExact(x any) any
- func SubtractExact(a, b any) any
- func ToIntExact(x any) any
- type Math
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PI = jmath.PI E = jmath.E )
View Source
var ( Sqrt = jmath.Sqrt Cbrt = jmath.Cbrt Sin = jmath.Sin Cos = jmath.Cos Tan = jmath.Tan Asin = jmath.Asin Acos = jmath.Acos Atan = jmath.Atan Sinh = jmath.Sinh Cosh = jmath.Cosh Tanh = jmath.Tanh Log = jmath.Log Log10 = jmath.Log10 Log1p = jmath.Log1p Exp = jmath.Exp Expm1 = jmath.Expm1 Ceil = jmath.Ceil Floor = jmath.Floor Rint = jmath.Rint Signum = jmath.Signum ToRadians = jmath.ToRadians ToDegrees = jmath.ToDegrees )
View Source
var ( Pow = jmath.Pow Atan2 = jmath.Atan2 CopySign = jmath.CopySign Hypot = jmath.Hypot IEEEremainder = jmath.IEEEremainder )
View Source
var Random = jmath.Random
View Source
var Round = jmath.Round
Functions ¶
func DecrementExact ¶
func IncrementExact ¶
func MultiplyExact ¶
func NegateExact ¶
func SubtractExact ¶
func ToIntExact ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.