---
title: "CFNumberGetValue(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfnumbergetvalue(_:_:_:)"
---

# CFNumberGetValue(_:_:_:)

Obtains the value of a CFNumber object cast to a specified type.

## Declaration

```swift
func CFNumberGetValue(_ number: CFNumber!, _ theType: CFNumberType, _ valuePtr: UnsafeMutableRawPointer!) -> Bool
```

## Parameters

- `number`: The CFNumber object to examine.
- `theType`: A constant that specifies the data type to return. See doc://com.apple.corefoundation/documentation/CoreFoundation/CFNumberType for a list of possible values.
- `valuePtr`: On return, contains the value of number.

## Return Value

Return Value true if the operation was successful, otherwise false.

## Discussion

Discussion If the argument type differs from the return type, and the conversion is lossy or the return value is out of range, then this function passes back an approximate value in valuePtr and returns false.

## See Also

### Getting Information About Numbers

- [CFNumberGetByteSize(_:)](corefoundation/cfnumbergetbytesize(_:).md)
- [CFNumberGetType(_:)](corefoundation/cfnumbergettype(_:).md)
- [CFNumberIsFloatType(_:)](corefoundation/cfnumberisfloattype(_:).md)
