home contribute faq download

FunctX XQuery Functions

fn:floor

Rounds down to the next lowest integer

Google
Webxqueryfunctions.com

Description

The fn:floor function returns the largest integer that is not greater than $arg. The result type depends the numeric type of the argument. If $arg is untyped, it is cast to xs:double.

This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book.

Arguments and Return Type

NameType
$arg numeric?
return value numeric?

Examples

XQuery ExampleResults
floor(5)
5
floor(5.1)
5
floor(5.7)
5
floor(-5.1)
-6
floor(-5.7)
-6
floor( () )
()

See Also

fn:ceilingRounds up to the next highest integer
fn:roundRounds a numeric value
fn:round-half-to-evenRounds a numeric value, rounding even halfs to the nearest even number

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26W3C, XQuery 1.0 and XPath 2.0 Functions and Operators, http://www.w3.org/TR/xpath-functions/
Datypic XQuery Services

Recommended Reading:

XQuery