[swift-evolution] Thoughts on clarity of Double and Float type names?

Ben Rimmington me at benrimmington.com
Mon Jun 20 06:22:44 CDT 2016


<http://thread.gmane.org/gmane.comp.lang.swift.evolution/2199/focus=18327>

I hope it's not too late to submit a proposal.

[stdlib/public/core/FloatingPointTypes.swift.gyb]

	public struct Float32: BinaryFloatingPoint
	public struct Float64: BinaryFloatingPoint
	public struct Float80: BinaryFloatingPoint

[stdlib/public/core/CTypes.swift]

	public typealias CFloat      = Float32
	public typealias CDouble     = Float64
	public typealias CLongDouble = Float80

[stdlib/public/core/Policy.swift]

	/// The default type for an otherwise-
	/// unconstrained floating point literal.
	public typealias FloatLiteralType = Float64

Clang importer example:

	/// The measurement value, represented as a
	/// double-precision floating-point number.
	public var doubleValue: CDouble { get }

Alternatives:

* IEEE 754 names: `Binary64` (or `Bin64`), etc.

* DEC64 <http://dec64.com> as the default number type!

-- Ben



More information about the swift-evolution mailing list