-
Notifications
You must be signed in to change notification settings - Fork 19
XPATH math:sin
JervenBolleman edited this page Jun 6, 2019
·
2 revisions
Signature
xsd:double sin (xsd:double)
The result is the sine of $θ (which is treated as an angle in radians) as defined in the [IEEE 754-2008] specification of the sin function applied to 64-bit binary floating point values.
This function is equivalent to as math:sin.
ASK {FILTER(SIN("0.0e0) = "0.0e0"^^xsd:double)}
ASK {FILTER(SIN("-0.0e0) = "-0.0e0"^^xsd:double)}
ASK {FILTER(SIN(PI() / 2) > "0.99"^^xsd:double)} #Approximate
ASK {FILTER(SIN(PI() / 2) < "1.01"^^xsd:double)}
ASK {FILTER(SIN(- (PI()) / 2) < "-0.99"^^xsd:double)} #Approximate
ASK {FILTER(SIN(- (PI()) / 2) > "-1.01"^^xsd:double)}
ASK {FILTER(SIN(PI()) > "-0.01"^^xsd:double)} #Approximate
ASK {FILTER(SIN(PI()) < "0.01"^^xsd:double)}
ASK {FILTER(SIN("-2.0e0) = "NaN"^^xsd:double)}
ASK {FILTER(SIN("NaN"^^xsd:double) = "NaN"^^xsd:double)}
ASK {FILTER(SIN("INF"^^xsd:double) = "NaN"^^xsd:double)}
ASK {FILTER(SIN("-INF"^^xsd:double) = "NaN"^^xsd:double)}
Should return true
SIN()
called without a variable/value should be a parse error.
SIN()
called with a numeric as the first ($x parameter) should have that cast to xsd:double.
Error values, is the approximate to lenient? double check the standards.