{"modulePath":"github.com/glojurelang/glojure","version":"v0.7.25","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package math\n\nPackage math exposes JVM-faithful java.lang.Math equivalents for code running on glojure. Each symbol is published two ways:\n\n  - 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\n  - through glojure's pkgmap (used by the REPL and any dynamic resolution path).\n\nJava'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.\n\n## Variables\n\n```go\nvar (\n\tPI = jmath.PI\n\tE  = jmath.E\n)\n```\n\n```go\nvar (\n\tSqrt      = jmath.Sqrt\n\tCbrt      = jmath.Cbrt\n\tSin       = jmath.Sin\n\tCos       = jmath.Cos\n\tTan       = jmath.Tan\n\tAsin      = jmath.Asin\n\tAcos      = jmath.Acos\n\tAtan      = jmath.Atan\n\tSinh      = jmath.Sinh\n\tCosh      = jmath.Cosh\n\tTanh      = jmath.Tanh\n\tLog       = jmath.Log\n\tLog10     = jmath.Log10\n\tLog1p     = jmath.Log1p\n\tExp       = jmath.Exp\n\tExpm1     = jmath.Expm1\n\tCeil      = jmath.Ceil\n\tFloor     = jmath.Floor\n\tRint      = jmath.Rint\n\tSignum    = jmath.Signum\n\tToRadians = jmath.ToRadians\n\tToDegrees = jmath.ToDegrees\n)\n```\n\n```go\nvar (\n\tPow           = jmath.Pow\n\tAtan2         = jmath.Atan2\n\tCopySign      = jmath.CopySign\n\tHypot         = jmath.Hypot\n\tIEEEremainder = jmath.IEEEremainder\n)\n```\n\n```go\nvar Random = jmath.Random\n```\n\n```go\nvar Round = jmath.Round\n```\n\n## Functions\n\n```go\nfunc Abs(x any) any\n```\n\n```go\nfunc AddExact(a, b any) any\n```\n\n```go\nfunc DecrementExact(x any) any\n```\n\n```go\nfunc FloorDiv(a, b any) any\n```\n\n```go\nfunc FloorMod(a, b any) any\n```\n\n```go\nfunc GetExponent(x any) int32\n```\n\n```go\nfunc IncrementExact(x any) any\n```\n\n```go\nfunc Max(a, b any) any\n```\n\n```go\nfunc Min(a, b any) any\n```\n\n```go\nfunc MultiplyExact(a, b any) any\n```\n\n```go\nfunc NegateExact(x any) any\n```\n\n```go\nfunc NewJavaRandom(args ...any) any\n```\n\n```go\nfunc NextAfter(start, direction any) any\n```\n\n```go\nfunc NextDown(x any) any\n```\n\n```go\nfunc NextUp(x any) any\n```\n\n```go\nfunc Scalb(x, scale any) any\n```\n\n```go\nfunc SubtractExact(a, b any) any\n```\n\n```go\nfunc ToIntExact(x any) any\n```\n\n```go\nfunc Ulp(x any) any\n```\n\n## Types\n\n```go\ntype JavaRandom struct {\n\t// contains filtered or unexported fields\n}\n```\nJavaRandom provides the small java.util.Random instance surface used by clojure.data.generators and other portable libraries.\n\n```go\nfunc (r *JavaRandom) NextBoolean() bool\n```\n\n```go\nfunc (r *JavaRandom) NextDouble() float64\n```\n\n```go\nfunc (r *JavaRandom) NextFloat() float32\n```\n\n```go\nfunc (r *JavaRandom) NextLong() int64\n```\n\n```go\ntype Math struct{}\n```\nMath is the placeholder type registered as java.lang.Math's reflect.Type. java.lang.Math is final with a private constructor in the JVM, so no instances ever exist; the value here only needs to make (instance? Class Math) succeed so (ns-imports \\*ns\\*) sees the import.\n\n","path":"github.com/glojurelang/glojure/pkg/javacompat/math","name":"math","synopsis":"Package math exposes JVM-faithful java.lang.Math equivalents for code running on glojure.","isRedistributable":true}
