rrrokhtar commented on PR #807:
URL: https://github.com/apache/age/pull/807#issuecomment-1507753138
@jrgemignani
> One of the jobs of an SE is questioning whether something is wise to do,
or not. But, let's suppose it is and go on to your next statement.
**Sometimes you need to proceed if you don't get the explanations/answers to
your questions.**
> Technically, you can, although it is cumbersome -
```SQL
psql-11.5-5432-pgsql=# SELECT * from cypher('graph1', $$ RETURN
pg_catalog.factorial(25::pg_bigint) $$) as (result numeric);
result
----------------------------
15511210043330985984000000
(1 row)
psql-11.5-5432-pgsql=#
```
Thanks for the explanation here I was not aware of needing to the type
casting here.
>But sqrt follows the cypher specification that states sqrt outputs a float.
There is no such specification for factorial as Neo4j doesn't have it. You need
to be careful just copying another function without checking, or thinking
about, how your functions' output should be represented and how the copied
function works. Additionally, your function causes a loss of precision due to
your variable usage.
**Is factorial not a standard outputs an integer? I am not sure what's the
problem with the usage of integer type here? do you want to use it smth like
big integer in postgresql?**
> Except that there are regression tests for all (unless we missed a few)
supported mathematical functions. Here is sqrt's -
**Cool, you have a point**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]