---
title: "scanFloat(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/scanner/scanfloat(_:)"
---

# scanFloat(_:)

Scans for a float value, returning a found value by reference.

## Declaration

```swift
func scanFloat(_ result: UnsafeMutablePointer<Float>?) -> Bool
```

## Parameters

- `result`: Upon return, contains the scanned value. Contains HUGE_VAL or –HUGE_VAL on overflow, or 0.0 on underflow.

## Return Value

Return Value true if the receiver finds a valid floating-point representation, otherwise false. Overflow or underflow are both considered valid floating-point representations.

## Discussion

Discussion Skips past excess digits in the case of overflow, so the scanner’s position is past the entire floating-point representation. Invoke this method with NULL as floatValue to simply scan past a float value representation. Floating-point representations are assumed to be IEEE compliant.

## See Also

### Related Documentation

- [floatValue](foundation/nsstring/floatvalue.md)

### Scanning Numeric Values

- [scanDecimal(_:)](foundation/scanner/scandecimal(_:).md)
- [scanDouble(_:)](foundation/scanner/scandouble(_:).md)
- [scanHexDouble(_:)](foundation/scanner/scanhexdouble(_:).md)
- [scanHexFloat(_:)](foundation/scanner/scanhexfloat(_:).md)
- [scanHexInt32(_:)](foundation/scanner/scanhexint32(_:).md)
- [scanHexInt64(_:)](foundation/scanner/scanhexint64(_:).md)
- [scanInt(_:)](foundation/scanner/scanint(_:).md)
- [scanInt32(_:)](foundation/scanner/scanint32(_:).md)
- [scanInt64(_:)](foundation/scanner/scanint64(_:).md)
- [scanUnsignedLongLong(_:)](foundation/scanner/scanunsignedlonglong(_:).md)
