com.marklogic.xcc.types

## Interface XSFloat

- All Superinterfaces:
    XdmAtomic, XdmItem, XdmValue

      public interface XSFloat
      extends XdmAtomic

  XDM type: xs:float.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.math.BigDecimal` | `asBigDecimal()` The item's value as a `BigDecimal`.
    `java.lang.Float` | `asFloat()` The item's value as a `Float`.
    `float` | `asPrimitiveFloat()` The item's value as a primitive float value.

    - ### Methods inherited from interface com.marklogic.xcc.types.XdmItem

      `asInputStream, asReader, getItemType, isCached, writeTo, writeTo`

    - ### Methods inherited from interface com.marklogic.xcc.types.XdmValue

      `asString, getValueType`

- - ### Method Detail

    - #### asFloat

          java.lang.Float asFloat()

      The item's value as a `Float`. Some precision may be lost by casting to the Java type.
      Returns:
        The value of this item as a Java Float object.
      See Also:
        `asBigDecimal()`

    - #### asPrimitiveFloat

          float asPrimitiveFloat()

      The item's value as a primitive float value. Some precision may be lost by casting to the Java type.
      Returns:
        The value of this item as a primitive Java float.
      See Also:
        `asBigDecimal()`

    - #### asBigDecimal

          java.math.BigDecimal asBigDecimal()

      The item's value as a `BigDecimal`. This value may preserve more precision than `asFloat()` or `asPrimitiveFloat()`.
      Returns:
        The value of this item as a Java BigDecimal object.

Copyright © 2025 MarkLogic Corporation. All Rights Reserved.

Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com