You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/reference/builtins.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,8 @@ A language-tagged string is a value like `"Hello world"@en`. The function `LANG`
48
48
All standard arithmetic operations, including addition (`+`), subtraction (`-`), multiplication (`*`), and division (`/`), are fully supported. Numeric values can also be compared via the operators `<`, `<=`, `=>`, and `>`.
49
49
50
50
In addition, Nemo provides many useful arithmetic functions. Currently, these include the following functions on single input parameters:
51
-
`ABS` (absolute), `SQRT` (square root), `SIN` (sine), `COS` (cosine), `TAN` (tangent), `ROUND` (rounding up or down), `CEIL` (rounding up), `FLOOR` (rounding down). Moreover, the following functions require two parameters:
and `INVERTSIGN` (multiply by negative one). Moreover, the following functions require two parameters:
52
53
-`LOG(x,y)`: computes the logarithm of x to base y
53
54
-`POW(x,y)`: computes the power of x to the y.
54
55
-`REM(x,y)`: computes the remainder of dividing x by y.
@@ -63,14 +64,18 @@ And finally, the following functions can be called with arbitrary many input par
63
64
-`BITOR(x_1, ..., x_n)`: computes the bitwise "or" of the given arguments
64
65
-`BITXOR(x_1, ..., x_n)`: computes the bitwise "xor" of the given arguments
65
66
67
+
It is also possible to mix numeric types, which implicitly converts them to 64-bit floating point numbers. For example, `SUM(3 * 4.0, 5, 1.0)` returns the 64-bit floating point number `18.0`.
68
+
69
+
### Conversion functions
70
+
66
71
Nemo supports the following conversion functions:
67
72
-`INT`: Convert the given value to an integer. This works for various datatypes (not just numbers), but only for data that already corresponds to an integer. The following all evaluate to `42`: `INT(42)`, `INT(42.0)`, `INT("42")`, `INT("42"^^<http://www.w3.org/2001/XMLSchema#gYear>)`, `INT(ROUND(42.1))`. However, `INT(42.1)` does not return a result.
68
73
-`DOUBLE`: Convert a given value to a double. This function works for various datatypes (not just numbers). For example, the following evaluate to `42.0`: `DOUBLE(42)`, `DOUBLE("42.0")`, `DOUBLE("42").`
69
74
-`FLOAT`: Convert a given value to a float. This is analogous to `DOUBLE` but for 32bit floating point numbers.
75
+
-`IRI`: Convert a string value into an IRI
70
76
71
-
It is also possible to mix numeric types, which implicitly converts them to 64-bit floating point numbers. For example, `SUM(3 * 4.0, 5, 1.0)` returns the 64-bit floating point number `18.0`.
72
77
73
-
### Boolean Functions
78
+
### Boolean functions
74
79
75
80
Nemo supports the usual Boolean functions (`AND`, `OR`, and `NOT`), but requires them to be written in prefix-notation like other functions, e.g., `OR(?X,?Y)` rather than `?X OR ?Y`.
76
81
@@ -101,7 +106,7 @@ Built-in functions can be nested arbitrarily. For example, the following is a va
0 commit comments