Skip to main content

sign

The mathematical signum function, returning -1, 0, or 1.

Parameter

Type

x

decimal, double, integer

Returns: integer

Example

Query:

PREFIX : <https://ddw-doccorp.linked.data.world/d/sparql-function-sample-queries/>
PREFIX fn: <http://data.world/function/functions#>

SELECT (fn:sign(3.0) AS ?sign)
{
}

Run query

Results:

sign

1