# FloatRange

Artifact: [androidx.annotation:annotation](https://developer.android.com/jetpack/androidx/releases/annotation) [View Source](https://cs.android.com/search?q=file:androidx/annotation/FloatRange.kt+class:androidx.annotation.FloatRange) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.0.0)

*** ** * ** ***

Common/AllAndroid/JVM
- Cmn

  ```
  @MustBeDocumented
  @Retention(value = AnnotationRetention.BINARY)
  @Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.ANNOTATION_CLASS])
  annotation FloatRange
  ```

*** ** * ** ***

Denotes that the annotated element should be a float or double in the given range

Example:

```kotlin
@FloatRange(from=0.0,to=1.0)
public float getAlpha() {
    ...
}
```

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange#FloatRange(kotlin.Double,kotlin.Double,kotlin.Boolean,kotlin.Boolean)( from: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, to: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, fromInclusive: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, toInclusive: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange#from()` Smallest value. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange#fromInclusive()` Whether the from value is included in the range | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange#to()` Largest value. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange#toInclusive()` Whether the to value is included in the range | Cmn |

## Public constructors

### FloatRange

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.10.0)

```
FloatRange(
    from: Double = Double.NEGATIVE_INFINITY,
    to: Double = Double.POSITIVE_INFINITY,
    fromInclusive: Boolean = true,
    toInclusive: Boolean = true
)
```

## Public properties

### from

Cmn

```
val from: Double
```

Smallest value. Whether it is inclusive or not is determined by .fromInclusive

### fromInclusive

Cmn

```
val fromInclusive: Boolean
```

Whether the from value is included in the range

### to

Cmn

```
val to: Double
```

Largest value. Whether it is inclusive or not is determined by .toInclusive

### toInclusive

Cmn

```
val toInclusive: Boolean
```

Whether the to value is included in the range