Skip to main content

docs/conformance/java-math-audit.md

<!-- Auto-generated — do not edit by hand -->
# Java Math Audit for PTC-Lisp

> **Warning:** This file is auto-generated by `mix ptc.gen_docs` from `priv/function_audit.exs`.
> Manual edits will be overwritten. Edit `priv/function_audit.exs` instead.

Comparison of `java.lang.Math` methods against PTC-Lisp builtins.

See also: [Function Reference](../function-reference.md) | [Namespace Coverage](index.md) | [Clojure Core Audit](clojure-core-audit.md) | [Clojure String Audit](clojure-string-audit.md) | [Clojure Set Audit](clojure-set-audit.md) | [Clojure Walk Audit](clojure-walk-audit.md) | [Java Boolean Audit](java-lang-boolean-audit.md) | [Java Double Audit](java-lang-double-audit.md) | [Java Float Audit](java-lang-float-audit.md) | [Java Integer Audit](java-lang-integer-audit.md) | [Java Long Audit](java-lang-long-audit.md) | [Java String Audit](java-lang-string-audit.md) | [Java System Audit](java-lang-system-audit.md) | [Java LocalDate Audit](java-time-local-date-audit.md) | [Java Instant Audit](java-time-instant-audit.md) | [Java Duration Audit](java-time-duration-audit.md) | [Java Period Audit](java-time-period-audit.md) | [Java Date Audit](java-util-date-audit.md)

## Summary

Coverage excludes `not_relevant` entries: `supported / (supported + candidate + not_classified)`.

| Status | Count |
|--------|-------|
| Supported | 8 |
| Candidate | 19 |
| Not Relevant | 22 |
| Not Classified | 0 |
| Relevant Target | 27 |
| Coverage | 8/27 (29.6%) |
| **Total** | **49** |

## Details

| Var | Status | Description | Notes |
|-----|--------|-------------|-------|
| `IEEEremainder` | ❌ not_relevant | Returns IEEE 754 remainder | low-level IEEE 754 semantics; use rem/mod |
| `abs` | ✅ supported | Returns the absolute value | DIV-45: uses PTC-Lisp arbitrary-precision integers, so abs returns the mathematically correct positive value and accepts BigInt input rather than reproducing Java long-overflow/overload artifacts |
| `acos` | 🔲 candidate | Returns the arc cosine of a value | pure math |
| `addExact` | ❌ not_relevant | Returns sum, throwing on overflow | Java overflow semantics not applicable on BEAM |
| `asin` | 🔲 candidate | Returns the arc sine of a value | pure math |
| `atan` | 🔲 candidate | Returns the arc tangent of a value | pure math |
| `atan2` | 🔲 candidate | Returns angle theta from (x,y) to polar (r,theta) | pure math |
| `cbrt` | 🔲 candidate | Returns the cube root of a value | pure math |
| `ceil` | ✅ supported | Returns the smallest integer >= argument | DIV-42: integer-returning PTC-Lisp extension, so finite results render as integers rather than Java's double shape |
| `copySign` | ❌ not_relevant | Returns first arg with sign of second arg | low-level IEEE 754 manipulation |
| `cos` | 🔲 candidate | Returns the trigonometric cosine of an angle | pure math |
| `cosh` | 🔲 candidate | Returns the hyperbolic cosine of a value | pure math |
| `decrementExact` | ❌ not_relevant | Returns argument decremented by one, throwing on overflow | Java overflow semantics not applicable on BEAM |
| `exp` | 🔲 candidate | Returns Euler's number e raised to the power of a | pure math |
| `expm1` | ❌ not_relevant | Returns e^x - 1 | specialized numerical precision, low demand |
| `floor` | ✅ supported | Returns the largest integer <= argument | DIV-42: integer-returning PTC-Lisp extension, so finite results render as integers rather than Java's double shape |
| `floorDiv` | ❌ not_relevant | Returns floor of integer division | Java integer division semantics; use quot + floor |
| `floorMod` | ❌ not_relevant | Returns floor modulus of arguments | Java integer semantics; use mod |
| `fma` | ❌ not_relevant | Fused multiply-add | specialized numerical precision |
| `getExponent` | ❌ not_relevant | Returns unbiased exponent of a float/double | low-level IEEE 754 inspection |
| `hypot` | 🔲 candidate | Returns sqrt(x^2 + y^2) without intermediate overflow | pure math |
| `incrementExact` | ❌ not_relevant | Returns argument incremented by one, throwing on overflow | Java overflow semantics not applicable on BEAM |
| `log` | 🔲 candidate | Returns the natural logarithm (base e) of a value | pure math |
| `log10` | 🔲 candidate | Returns the base 10 logarithm of a value | pure math |
| `log1p` | ❌ not_relevant | Returns ln(1 + x) | specialized numerical precision, low demand |
| `max` | ✅ supported | Returns the greater of two values | DIV-44: max is the Clojure-named variadic helper (Math/max is an alias), not Java's two-argument primitive. DIV-45: mixed numeric and total-ordering comparisons are accepted via PTC-Lisp's generic value model rather than Java's primitive overloads |
| `min` | ✅ supported | Returns the smaller of two values | DIV-44: min is the Clojure-named variadic helper (Math/min is an alias), not Java's two-argument primitive. DIV-45: mixed numeric and total-ordering comparisons are accepted via PTC-Lisp's generic value model rather than Java's primitive overloads |
| `multiplyExact` | ❌ not_relevant | Returns product, throwing on overflow | Java overflow semantics not applicable on BEAM |
| `multiplyHigh` | ❌ not_relevant | Returns high 64 bits of 128-bit product | low-level 64-bit arithmetic |
| `negateExact` | ❌ not_relevant | Returns negation, throwing on overflow | Java overflow semantics not applicable on BEAM |
| `nextAfter` | ❌ not_relevant | Returns adjacent floating-point value | low-level IEEE 754 manipulation |
| `nextDown` | ❌ not_relevant | Returns adjacent floating-point value towards negative infinity | low-level IEEE 754 manipulation |
| `nextUp` | ❌ not_relevant | Returns adjacent floating-point value towards positive infinity | low-level IEEE 754 manipulation |
| `pow` | ✅ supported | Returns the value of a raised to the power of b | Follows java.lang.Math.pow's IEEE 754 special-case table, returning :nan / :infinity / :negative_infinity as recoverable signal values instead of raising (e.g. (pow -1 0.5) => NaN, (pow 0 -1) => Inf) |
| `random` | 🔲 candidate | Returns a pseudorandom double between 0.0 and 1.0 | pure (non-deterministic but side-effect free) |
| `rint` | ❌ not_relevant | Returns closest double to argument that is a mathematical integer | use round instead |
| `round` | ✅ supported | Returns the closest long/int to the argument | DIV-43: round-half-away-from-zero, integer result, and special values (NaN/infinity) are preserved rather than Java's floor(x+0.5) and long saturation. DIV-45: integer and BigInt arguments are accepted (returned unchanged) via PTC-Lisp's value model rather than Java's float/double-only overloads |
| `scalb` | ❌ not_relevant | Returns d × 2^scaleFactor | low-level IEEE 754 manipulation |
| `signum` | 🔲 candidate | Returns the signum function of the argument | pure math |
| `sin` | 🔲 candidate | Returns the trigonometric sine of an angle | pure math |
| `sinh` | 🔲 candidate | Returns the hyperbolic sine of a value | pure math |
| `sqrt` | ✅ supported | Returns the positive square root of a value |  |
| `subtractExact` | ❌ not_relevant | Returns difference, throwing on overflow | Java overflow semantics not applicable on BEAM |
| `tan` | 🔲 candidate | Returns the trigonometric tangent of an angle | pure math |
| `tanh` | 🔲 candidate | Returns the hyperbolic tangent of a value | pure math |
| `toDegrees` | 🔲 candidate | Converts an angle from radians to degrees | pure math |
| `toIntExact` | ❌ not_relevant | Returns long narrowed to int, throwing on overflow | Java type narrowing not applicable on BEAM |
| `toRadians` | 🔲 candidate | Converts an angle from degrees to radians | pure math |
| `ulp` | ❌ not_relevant | Returns size of an ulp of the argument | low-level IEEE 754 inspection |