Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update math functions #1719

Merged
merged 1 commit into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs-2.0/2.quick-start/6.cheatsheet-for-ngql.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
| double rand() | Returns a random floating point number in the range from 0 (inclusive) to 1 (exclusive); i.e.[0,1). |
| int rand32(int min, int max) | Returns a random 32-bit integer in `[min, max)`.<br/>If you set only one argument, it is parsed as `max` and `min` is `0` by default.<br/>If you set no argument, the system returns a random signed 32-bit integer. |
| int rand64(int min, int max) | Returns a random 64-bit integer in `[min, max)`.<br/>If you set only one argument, it is parsed as `max` and `min` is `0` by default.<br/>If you set no argument, the system returns a random signed 64-bit integer. |
| std() | Returns the population standard deviation. |
| sum() | Returns the sum value. |
| bit_and() | Bitwise AND. |
| bit_or() | Bitwise OR. |
| bit_xor() | Bitwise XOR. |
Expand All @@ -49,6 +47,9 @@
| max() | Returns the maximum value. |
| min() | Returns the minimum value. |
| collect() | The collect() function returns a list containing the values returned by an expression. Using this function aggregates data by merging multiple records or values into a single list. |
| std() | Returns the population standard deviation. |
| sum() | Returns the sum value. |


- [String functions](../3.ngql-guide/6.functions-and-expressions/2.string.md)

Expand Down
38 changes: 0 additions & 38 deletions docs-2.0/3.ngql-guide/6.functions-and-expressions/1.math.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,44 +486,6 @@ nebula> RETURN rand64(1,100);
+---------------+
```

## std()

std() returns the population standard deviation.

Syntax: `std(<expression>)`

- Result type: Double

Example:

```ngql
nebula> MATCH (v:player) RETURN std(v.player.age);
+-------------------+
| std(v.player.age) |
+-------------------+
| 6.423895701687502 |
+-------------------+
```

## sum()

sum() returns the sum value.

Syntax: `sum(<expression>)`

- Result type: Same as the original argument.

Example:

```ngql
nebula> MATCH (v:player) RETURN sum(v.player.age);
+-------------------+
| sum(v.player.age) |
+-------------------+
| 1698 |
+-------------------+
```

## bit_and()

bit_and() returns the result of bitwise AND.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,43 @@ nebula> GO FROM "player100" OVER follow YIELD dst(edge) AS dst, properties($$).
| "player125" | 84.0 |
| "player101" | 74.0 |
+-------------+------------+
```


## std()

std() returns the population standard deviation.

Syntax: `std(<expression>)`

- Result type: Double

Example:

```ngql
nebula> MATCH (v:player) RETURN std(v.player.age);
+-------------------+
| std(v.player.age) |
+-------------------+
| 6.423895701687502 |
+-------------------+
```

## sum()

sum() returns the sum value.

Syntax: `sum(<expression>)`

- Result type: Same as the original argument.

Example:

```ngql
nebula> MATCH (v:player) RETURN sum(v.player.age);
+-------------------+
| sum(v.player.age) |
+-------------------+
| 1698 |
+-------------------+
```