Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: fix (2022-10) #12665

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
examples: fix (2022-10)
  • Loading branch information
maiha committed Oct 26, 2022
commit e5d351e2ad60ee1f155497dff38914e145ff69c6
2 changes: 1 addition & 1 deletion src/digest/digest.cr
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ abstract class Digest
# ctx.update "f"
# ctx.update "oo"
# end
# digest.hexfinal # => "acbd18db4cc2f85cedef654fccc4a4d8"
# digest.hexstring # => "acbd18db4cc2f85cedef654fccc4a4d8"
# ```
def digest(& : self ->) : Bytes
context = new
2 changes: 1 addition & 1 deletion src/kernel.cr
Original file line number Diff line number Diff line change
@@ -298,7 +298,7 @@ end
# sprintf "%b", -123 # => "-1111011"
# sprintf "%#b", 0 # => "0"
# sprintf "% b", 123 # => " 1111011"
# sprintf "%+ b", 123 # => "+ 1111011"
# sprintf "%+ b", 123 # => "+1111011"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have correct spec of printf, but many implementations say so.

[crystal-1.6.1-dev]
sprintf "%+ b", 123 # => "+1111011"

[ruby-3.2.0-dev]
sprintf "%+ b", 123 # => "+1111011"

[go-1.1.9]
fmt.Sprintf("%+ b", 123) // => "+1111011"

# sprintf "% b", -123 # => "-1111011"
# sprintf "%+ b", -123 # => "-1111011"
# sprintf "%#b", 123 # => "0b1111011"