Skip to content

Commit

Permalink
Documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilson committed Dec 5, 2024
1 parent f1f7c99 commit fc249dc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cpp/src/arrow/compute/api_scalar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -740,17 +740,17 @@ SCALAR_ARITHMETIC_UNARY(Ln, "ln", "ln_checked")
SCALAR_ARITHMETIC_UNARY(Log10, "log10", "log10_checked")
SCALAR_ARITHMETIC_UNARY(Log1p, "log1p", "log1p_checked")
SCALAR_ARITHMETIC_UNARY(Log2, "log2", "log2_checked")
SCALAR_ARITHMETIC_UNARY(Sqrt, "sqrt", "sqrt_checked")
SCALAR_ARITHMETIC_UNARY(Negate, "negate", "negate_checked")
SCALAR_ARITHMETIC_UNARY(Sin, "sin", "sin_checked")
SCALAR_ARITHMETIC_UNARY(Sqrt, "sqrt", "sqrt_checked")
SCALAR_ARITHMETIC_UNARY(Tan, "tan", "tan_checked")
SCALAR_EAGER_UNARY(Asinh, "asinh")
SCALAR_EAGER_UNARY(Cosh, "cosh")
SCALAR_EAGER_UNARY(Sinh, "sinh")
SCALAR_EAGER_UNARY(Tanh, "tanh")
SCALAR_EAGER_UNARY(Atan, "atan")
SCALAR_EAGER_UNARY(Cosh, "cosh")
SCALAR_EAGER_UNARY(Exp, "exp")
SCALAR_EAGER_UNARY(Sign, "sign")
SCALAR_EAGER_UNARY(Sinh, "sinh")
SCALAR_EAGER_UNARY(Tanh, "tanh")

Result<Datum> Round(const Datum& arg, RoundOptions options, ExecContext* ctx) {
return CallFunction("round", {arg}, &options, ctx);
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ const FunctionDoc sin_checked_doc{"Compute the sine",
"to return NaN instead, see \"sin\"."),
{"x"}};

const FunctionDoc sinh_doc{"Compute the hyperblic sine", (""), {"x"}};
const FunctionDoc sinh_doc{"Compute the hyperbolic sine", (""), {"x"}};

const FunctionDoc cos_doc{"Compute the cosine",
("NaN is returned for invalid input values;\n"
Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,6 @@ TYPED_TEST(TestUnaryArithmeticFloating, TrigSinh) {
return Sinh(arg, ctx);
};

this->SetNansEqual(true);
this->AssertUnaryOp(sinh, "[Inf, -Inf]", "[Inf, -Inf]");
this->AssertUnaryOp(sinh, "[]", "[]");
this->AssertUnaryOp(sinh, "[null, NaN]", "[null, NaN]");
Expand Down
29 changes: 29 additions & 0 deletions docs/source/cpp/compute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,35 @@ Decimal values are accepted, but are cast to Float64 first.
| tan_checked | Unary | Float32/Float64/Decimal | Float32/Float64 |
+--------------------------+------------+-------------------------+---------------------+

Hyperbolic trigonometric functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hyperbolic trigonometric functions are also supported, and, where applicable, also offer
``_checked`` variants that check for domain errors if needed.

Decimal values are accepted, but are cast to Float64 first.

+--------------------------+------------+-------------------------+---------------------+
| Function name | Arity | Input types | Output type |
+==========================+============+=========================+=====================+
| acosh | Unary | Float32/Float64/Decimal | Float32/Float64 |
+--------------------------+------------+-------------------------+---------------------+
| acosh_checked | Unary | Float32/Float64/Decimal | Float32/Float64 |
+--------------------------+------------+-------------------------+---------------------+
| asinh | Unary | Float32/Float64/Decimal | Float32/Float64 |
+--------------------------+------------+-------------------------+---------------------+
| atanh | Unary | Float32/Float64/Decimal | Float32/Float64 |
+--------------------------+------------+-------------------------+---------------------+
| atanh_checked | Unary | Float32/Float64/Decimal | Float32/Float64 |
+--------------------------+------------+-------------------------+---------------------+
| cosh | Unary | Float32/Float64/Decimal | Float32/Float64 |
+--------------------------+------------+-------------------------+---------------------+
| sinh | Unary | Float32/Float64/Decimal | Float32/Float64 |
+--------------------------+------------+-------------------------+---------------------+
| tanh | Unary | Float32/Float64/Decimal | Float32/Float64 |
+--------------------------+------------+-------------------------+---------------------+


Comparisons
~~~~~~~~~~~

Expand Down

0 comments on commit fc249dc

Please sign in to comment.