<!--
{
  "availability" : [
    "iOS: 2.0.0 - 13.0.0",
    "iPadOS: 2.0.0 - 13.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.0.0 - 10.15.0",
    "tvOS: 9.0.0 - 13.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 6.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Scanner/scanDouble(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScanner(im)scanDouble:"
  },
  "title" : "scanDouble(_:)"
}
-->

# scanDouble(_:)

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

```
func scanDouble(_ result: UnsafeMutablePointer<Double>?) -> Bool
```

## Parameters

`result`

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

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the receiver finds a valid floating-point representation, otherwise <doc://com.apple.documentation/documentation/Swift/false>. Overflow or underflow are both considered valid floating-point representations.

## 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 `doubleValue` to simply scan past a double value representation. Floating-point representations are assumed to be IEEE compliant.

## See Also

[`doubleValue`](/documentation/Foundation/NSString/doubleValue)

The floating-point value of the string as a `double`.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)