# FloatFloatPair

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

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  value class FloatFloatPair
  ```

*** ** * ** ***

Container to ease passing around a tuple of two `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` values.

*Note* : This class is optimized by using a value class, a Kotlin language featured not available from Java code. Java developers can get the same functionality by using `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html` or by constructing a custom implementation using Float parameters directly (see `https://developer.android.com/reference/kotlin/androidx/collection/LongLongPair` for an example).

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#FloatFloatPair(kotlin.Float,kotlin.Float)(first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Constructs a `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair` with two `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` values. | Cmn |

| ### Public functions |
|---|---|---|
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#component1()()` Returns the `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#first()` component of the pair. | Cmn |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#component2()()` Returns the `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#second()` component of the pair. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#first()` The first value in the pair. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#packedValue()` The internal representation of the `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#second()` The second value in the pair. | Cmn |

## Public constructors

### FloatFloatPair

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

```
FloatFloatPair(first: Float, second: Float)
```

Constructs a `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair` with two `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` values.

| Parameters |
|---|---|
| `first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the first value in the pair |
| `second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the second value in the pair |

## Public functions

### component1

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

```
inline operator fun component1(): Float
```

Returns the `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#first()` component of the pair. For instance, the first component of `PairFloatFloat(3f, 4f)` is `3f`.

This method allows to use destructuring declarations when working with pairs, for example:

```kotlin
val (first, second) = myPair
```

### component2

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

```
inline operator fun component2(): Float
```

Returns the `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#second()` component of the pair. For instance, the second component of `PairFloatFloat(3f, 4f)` is `4f`.

This method allows to use destructuring declarations when working with pairs, for example:

```kotlin
val (first, second) = myPair
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### first

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

```
val first: Float
```

The first value in the pair.

### packedValue

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

```
val packedValue: Long
```

The internal representation of the `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair`. `https://developer.android.com/reference/kotlin/androidx/collection/FloatFloatPair#(kotlin.Long)` has no guarantees for stability across library versions.

### second

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

```
val second: Float
```

The second value in the pair.