Skip to content

Commit

Permalink
Update binary integer description documentation (#134).
Browse files Browse the repository at this point in the history
  • Loading branch information
oscbyspro committed Nov 20, 2024
1 parent afa53a2 commit f72bf37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ You may need to convert binary integers to human-readable text. In that case, `d

let fib1e6 = IXL.fibonacci(1_000_000) // 0.015s
let fib1e6r10 = fib1e6.description(using: .decimal) // 0.297s (208988 numerals)
let fib1e6s10 = IXL(((fib1e6r10)), using: .decimal) // 0.040s (208988 numerals)
let fib1e6r16 = fib1e6.description(using: .hexadecimal) // 0.002s (173561 numerals)

try IXL(fib1e6r10, using: .decimal) // 0.040s (208988 numerals)
try IXL(fib1e6r16, using: .hexadecimal) // 0.002s (173561 numerals)
let fib1e6s16 = IXL(((fib1e6r16)), using: .hexadecimal) // 0.002s (173561 numerals)
```

<a name="overview-the-fallible-redemption-arc"/>
Expand Down
4 changes: 2 additions & 2 deletions Sources/CoreKit/BinaryInteger+Text.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// MARK: Initializers
//=------------------------------------------------------------------------=

/// Returns the `value` of `description`, or `nil`.
/// Returns the exact `value` of `description`, or `nil`.
///
/// ```swift
/// format.decode(description)?.optional()
Expand All @@ -38,7 +38,7 @@
self.init(description, using: TextInt.decimal)
}

/// Returns the `value` of `description`, or `nil`.
/// Returns the exact `value` of `description`, or `nil`.
///
/// ```swift
/// format.decode(description)?.optional()
Expand Down
4 changes: 2 additions & 2 deletions Sources/StdlibIntKit/StdlibInt+Text.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension StdlibInt {
// MARK: Initializers
//=------------------------------------------------------------------------=

/// Decodes the decimal `description`, if possible.
/// Returns the exact `value` of `description`, or `nil`.
///
/// ```swift
/// format.decode(description)?.optional()
Expand All @@ -46,7 +46,7 @@ extension StdlibInt {
}
}

/// Decodes the `description` using the given `format`, if possible.
/// Returns the exact `value` of `description`, or `nil`.
///
/// ```swift
/// format.decode(description)?.optional()
Expand Down

0 comments on commit f72bf37

Please sign in to comment.