---
title: CGFloat
framework: corefoundation
role: symbol
role_heading: Structure
path: corefoundation/cgfloat-swift.struct
---

# CGFloat

The basic type for floating-point scalar values in Core Graphics and related frameworks.

## Declaration

```swift
@frozen struct CGFloat
```

## Overview

Overview The size and precision of this type depend on the CPU architecture. When you build for a 64-bit CPU, the CGFloat type is a 64-bit, IEEE double-precision floating point type, equivalent to the Double type. When you build for a 32-bit CPU, the CGFloat type is a 32-bit, IEEE single-precision floating point type, equivalent to the Float type.

## Topics

### Initializers

- [init()](corefoundation/cgfloat-swift.struct/init().md)
- [init(_:)](corefoundation/cgfloat-swift.struct/init(_:)-7dkuk.md)
- [init(_:)](corefoundation/cgfloat-swift.struct/init(_:)-99gmf.md)
- [init(bitPattern:)](corefoundation/cgfloat-swift.struct/init(bitpattern:).md)
- [init(exactly:)](corefoundation/cgfloat-swift.struct/init(exactly:).md)
- [init(nan:signaling:)](corefoundation/cgfloat-swift.struct/init(nan:signaling:).md)
- [init(truncating:)](corefoundation/cgfloat-swift.struct/init(truncating:).md)

### Instance Properties

- [bitPattern](corefoundation/cgfloat-swift.struct/bitpattern.md)
- [native](corefoundation/cgfloat-swift.struct/native.md)

### Type Aliases

- [CGFloat.NativeType](corefoundation/cgfloat-swift.struct/nativetype.md)

### Default Implementations

- [CustomReflectable Implementations](corefoundation/cgfloat-swift.struct/customreflectable-implementations.md)
- [CustomStringConvertible Implementations](corefoundation/cgfloat-swift.struct/customstringconvertible-implementations.md)
- [ExpressibleByFloatLiteral Implementations](corefoundation/cgfloat-swift.struct/expressiblebyfloatliteral-implementations.md)
- [ExpressibleByIntegerLiteral Implementations](corefoundation/cgfloat-swift.struct/expressiblebyintegerliteral-implementations.md)
- [Hashable Implementations](corefoundation/cgfloat-swift.struct/hashable-implementations.md)
- [Strideable Implementations](corefoundation/cgfloat-swift.struct/strideable-implementations.md)

## Relationships

### Conforms To

- [AdditiveArithmetic](swift/additivearithmetic.md)
- [Animatable](swiftui/animatable.md)
- [BinaryFloatingPoint](swift/binaryfloatingpoint.md)
- [BitwiseCopyable](swift/bitwisecopyable.md)
- [CVAttachmentValueRepresentable](corevideo/cvattachmentvaluerepresentable.md)
- [CVarArg](swift/cvararg.md)
- [Comparable](swift/comparable.md)
- [Copyable](swift/copyable.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [ExpressibleByFloatLiteral](swift/expressiblebyfloatliteral.md)
- [ExpressibleByIntegerLiteral](swift/expressiblebyintegerliteral.md)
- [FloatingPoint](swift/floatingpoint.md)
- [Hashable](swift/hashable.md)
- [Numeric](swift/numeric.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SignedNumeric](swift/signednumeric.md)
- [Strideable](swift/strideable.md)
- [VectorArithmetic](swiftui/vectorarithmetic.md)

## See Also

### Structures

- [CGAffineTransform](corefoundation/cgaffinetransform.md)
- [CGAffineTransformComponents](corefoundation/cgaffinetransformcomponents.md)
- [CGPoint](corefoundation/cgpoint.md)
- [CGRect](corefoundation/cgrect.md)
- [CGSize](corefoundation/cgsize.md)
- [CGVector](corefoundation/cgvector.md)
