Skip to content

Commit 08ba650

Browse files
New hyperbolic trig functions (#1191)
New hyperbolic trig functions :) --------- Co-authored-by: Jens Pryce-Åklundh <[email protected]>
1 parent d6235c9 commit 08ba650

File tree

5 files changed

+220
-2
lines changed

5 files changed

+220
-2
lines changed

modules/ROOT/pages/appendix/gql-conformance/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:description: Overview of Cypher's conformance to GQL.
22
= GQL conformance
33

4-
*Last updated*: 27 February 2025 +
4+
*Last updated*: 4 March 2025 +
55
*Neo4j version*: 2025.03
66

77
GQL is the new link:https://www.iso.org/home.html[ISO] International Standard query language for graph databases.

modules/ROOT/pages/appendix/gql-conformance/supported-optional.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Cypher only supports xref:functions/mathematical-numeric.adoc#functions-ceil[`ce
119119

120120
| GF02
121121
| Trigonometric functions
122-
| xref:functions/mathematical-trigonometric.adoc#functions-acos[`acos()`], xref:functions/mathematical-trigonometric.adoc#functions-asin[`asin()`], xref:functions/mathematical-trigonometric.adoc#functions-atan[`atan()`], xref:functions/mathematical-trigonometric.adoc#functions-cos[`cos()`], xref:functions/mathematical-trigonometric.adoc#functions-cot[`cot()`], xref:functions/mathematical-trigonometric.adoc#functions-degrees[`degrees()`], xref:functions/mathematical-trigonometric.adoc#functions-radians[`radians()`], xref:functions/mathematical-trigonometric.adoc#functions-tan[`tan()`]
122+
| xref:functions/mathematical-trigonometric.adoc#functions-acos[`acos()`], xref:functions/mathematical-trigonometric.adoc#functions-asin[`asin()`], xref:functions/mathematical-trigonometric.adoc#functions-atan[`atan()`], xref:functions/mathematical-trigonometric.adoc#functions-cos[`cos()`], xref::functions/mathematical-trigonometric.adoc#functions-cosh[`cosh()`], xref:functions/mathematical-trigonometric.adoc#functions-cot[`cot()`], xref:functions/mathematical-trigonometric.adoc#functions-degrees[`degrees()`], xref:functions/mathematical-trigonometric.adoc#functions-radians[`radians()`], xref::functions/mathematical-trigonometric.adoc#functions-sin[`sin()`], xref::functions/mathematical-trigonometric.adoc#functions-sinh[`sinh()`], xref:functions/mathematical-trigonometric.adoc#functions-tan[`tan()`], xref::functions/mathematical-trigonometric.adoc#functions-tanh[`tanh()`]
123123
|
124124

125125
| GF03

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,16 @@ CREATE DATABASE db OPTIONS { seedRestoreUntil: ... }
291291
| The option `seedRestoreUntil` can now be specified in the `CREATE DATABASE` `OPTIONS` map.
292292
This allows a database to be seeded up to a specific date or transaction ID.
293293
For more information, see link:{neo4j-docs-base-uri}/operations-manual/current/clustering/databases/#cluster-seed-uri[Operations Manual -> Clustering -> Seed from URI].
294+
295+
a|
296+
label:functionality[]
297+
label:new[]
298+
[source, cypher, role="noheader"]
299+
----
300+
RETURN cosh(0.5), coth(0.5), sinh(0.5), tanh(0.5)
301+
----
302+
| Introduction of four new hyperbolic trigonometric Cypher functions.
303+
For more information, see xref:functions/mathematical-trigonometric.adoc[Mathematical functions - trigonometric].
294304
|===
295305

296306
[[cypher-deprecations-additions-removals-2025.01]]

modules/ROOT/pages/functions/index.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,20 @@ All trigonometric functions operate on radians, unless otherwise specified.
310310
| `cos(input :: FLOAT) :: FLOAT`
311311
| Returns the cosine of a `FLOAT`.
312312

313+
1.1+| xref::functions/mathematical-trigonometric.adoc#functions-cosh[`cosh()`]
314+
| `cosh(input :: FLOAT) :: FLOAT`
315+
| Returns the hyperbolic cosine of a `FLOAT`.
316+
label:new[Introduced in 2025.03]
317+
313318
1.1+| xref::functions/mathematical-trigonometric.adoc#functions-cot[`cot()`]
314319
| `cot(input :: FLOAT) :: FLOAT`
315320
| Returns the cotangent of a `FLOAT`.
316321

322+
1.1+| xref::functions/mathematical-trigonometric.adoc#functions-coth[`coth()`]
323+
| `coth(input :: FLOAT) :: FLOAT`
324+
| Returns the hyperbolic cotangent of a `FLOAT`.
325+
label:new[Introduced in 2025.03]
326+
317327
1.1+| xref::functions/mathematical-trigonometric.adoc#functions-degrees[`degrees()`]
318328
| `degrees(input :: FLOAT) :: FLOAT`
319329
| Converts radians to degrees.
@@ -334,10 +344,20 @@ All trigonometric functions operate on radians, unless otherwise specified.
334344
| `sin(input :: FLOAT) :: FLOAT`
335345
| Returns the sine of a `FLOAT`.
336346

347+
1.1+| xref::functions/mathematical-trigonometric.adoc#functions-sinh[`sinh()`]
348+
| `sinh(input :: FLOAT) :: FLOAT`
349+
| Returns the hyperbolic sine of a `FLOAT`.
350+
label:new[Introduced in 2025.03]
351+
337352
1.1+| xref::functions/mathematical-trigonometric.adoc#functions-tan[`tan()`]
338353
| `tan(input :: FLOAT) :: FLOAT`
339354
| Returns the tangent of a `FLOAT`.
340355

356+
1.1+| xref::functions/mathematical-trigonometric.adoc#functions-tanh[`tanh()`]
357+
| `tanh(input :: FLOAT) :: FLOAT`
358+
| Returns the hyperbolic tangent of a `FLOAT`.
359+
label:new[Introduced in 2025.03]
360+
341361
|===
342362

343363

modules/ROOT/pages/functions/mathematical-trigonometric.adoc

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,52 @@ The cosine of `0.5` is returned.
234234
235235
======
236236

237+
[role=label--new-2025.03]
238+
[[functions-cosh]]
239+
== cosh()
240+
241+
.Details
242+
|===
243+
| *Syntax* 3+| `cosh(input)`
244+
| *Description* 3+| Returns the hyperbolic cosine of a `FLOAT`.
245+
.2+| *Arguments* | *Name* | *Type* | *Description*
246+
| `input` | `FLOAT` | A value.
247+
| *Returns* 3+| `FLOAT`
248+
|===
249+
250+
.Considerations
251+
|===
252+
253+
| `cosh(null)` returns `null`.
254+
255+
|===
256+
257+
258+
.+cosh()+
259+
======
260+
261+
.Query
262+
// tag::functions_mathematical_trigonometric_cos[]
263+
[source, cypher, indent=0]
264+
----
265+
RETURN cosh(0.7)
266+
----
267+
// end::functions_mathematical_trigonometric_cos[]
268+
269+
The hyperbolic cosine of `0.7` is returned.
270+
271+
.Result
272+
[role="queryresult",options="header,footer",cols="1*<m"]
273+
|===
274+
275+
| cosh(0.7)
276+
| 1.255169005630943
277+
1+d|Rows: 1
278+
279+
|===
280+
281+
======
282+
237283

238284
[[functions-cot]]
239285
== cot()
@@ -281,6 +327,53 @@ The cotangent of `0.5` is returned.
281327
======
282328

283329

330+
[role=label--new-2025.03]
331+
[[functions-coth]]
332+
== coth()
333+
334+
.Details
335+
|===
336+
| *Syntax* 3+| `coth(input)`
337+
| *Description* 3+| Returns the hyperbolic cotangent of a `FLOAT`.
338+
.2+| *Arguments* | *Name* | *Type* | *Description*
339+
| `input` | `FLOAT` | A value.
340+
| *Returns* 3+| `FLOAT`
341+
|===
342+
343+
.Considerations
344+
|===
345+
346+
| `coth(null)` returns `null`.
347+
| `coth(0)` returns `NaN`.
348+
349+
|===
350+
351+
.+coth()+
352+
======
353+
354+
.Query
355+
// tag::functions_mathematical_trigonometric_cot[]
356+
[source, cypher, indent=0]
357+
----
358+
RETURN coth(0.7)
359+
----
360+
// end::functions_mathematical_trigonometric_cot[]
361+
362+
The hyperbolic cotangent of `0.7` is returned.
363+
364+
.Result
365+
[role="queryresult",options="header,footer",cols="1*<m"]
366+
|===
367+
368+
| coth(0.7)
369+
| 1.654621635803
370+
1+d|Rows: 1
371+
372+
|===
373+
374+
======
375+
376+
284377
[[functions-degrees]]
285378
== degrees()
286379

@@ -535,6 +628,53 @@ The sine of `0.5` is returned.
535628
======
536629

537630

631+
[role=label--new-2025.03]
632+
[[functions-sinh]]
633+
== sinh()
634+
635+
.Details
636+
|===
637+
| *Syntax* 3+| `sinh(input)`
638+
| *Description* 3+| Returns the hyperbolic sine of a `FLOAT`.
639+
.2+| *Arguments* | *Name* | *Type* | *Description*
640+
| `input` | `FLOAT` | A value.
641+
| *Returns* 3+| `FLOAT`
642+
|===
643+
644+
.Considerations
645+
|===
646+
647+
| `sinh(null)` returns `null`.
648+
649+
|===
650+
651+
652+
.+sinh()+
653+
======
654+
655+
.Query
656+
// tag::functions_mathematical_trigonometric_sin[]
657+
[source, cypher, indent=0]
658+
----
659+
RETURN sinh(0.7)
660+
----
661+
// end::functions_mathematical_trigonometric_sin[]
662+
663+
The hyperbolic sine of `0.7` is returned.
664+
665+
.Result
666+
[role="queryresult",options="header,footer",cols="1*<m"]
667+
|===
668+
669+
| sinh(0.7)
670+
| 0.75858370184
671+
1+d|Rows: 1
672+
673+
|===
674+
675+
======
676+
677+
538678
[[functions-tan]]
539679
== tan()
540680

@@ -580,3 +720,51 @@ The tangent of `0.5` is returned.
580720
581721
======
582722

723+
724+
725+
[role=label--new-2025.03]
726+
[[functions-tanh]]
727+
== tanh()
728+
729+
.Details
730+
|===
731+
| *Syntax* 3+| `tanh(input)`
732+
| *Description* 3+| Returns the hyperbolic tangent of a `FLOAT`.
733+
.2+| *Arguments* | *Name* | *Type* | *Description*
734+
| `input` | `FLOAT` | A value.
735+
| *Returns* 3+| `FLOAT`
736+
|===
737+
738+
.Considerations
739+
|===
740+
741+
| `tanh(null)` returns `null`.
742+
743+
|===
744+
745+
746+
.+tanh()+
747+
======
748+
749+
.Query
750+
// tag::functions_mathematical_trigonometric_tan[]
751+
[source, cypher, indent=0]
752+
----
753+
RETURN tanh(0.7)
754+
----
755+
// end::functions_mathematical_trigonometric_tan[]
756+
757+
The hyperbolic tangent of `0.7` is returned.
758+
759+
.Result
760+
[role="queryresult",options="header,footer",cols="1*<m"]
761+
|===
762+
763+
| tanh(0.7)
764+
| 0.604367777117
765+
1+d|Rows: 1
766+
767+
|===
768+
769+
======
770+

0 commit comments

Comments
 (0)