What is the Double.binade property in Swift?

Overview

Double.binade double instance property in Swift that gets the floating-point value with the same sign and exponent as this value, but with a significand of 1.0.

Syntax

Double.binade

Return value

This property returns a floating-point value.

Code example

// Create some double values
let d1 = 1.1
let d2 = 0.0
let d3 = -4.5
let d4 = Double.infinity
// Get the binade
print(d1.binade)
print(d2.binade)
print(d3.binade)
print(d4.binade)

Explanation

  • Lines 2 to 5: We create some double values.
  • Lines 8 to 11: We print the binade property value of each double value.

Free Resources