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

[Feature Request] Add bin() builtin function #2604

Closed
1 task done
bgreni opened this issue May 10, 2024 · 1 comment
Closed
1 task done

[Feature Request] Add bin() builtin function #2604

bgreni opened this issue May 10, 2024 · 1 comment
Labels
enhancement New feature or request mojo-repo Tag all issues with this label

Comments

@bgreni
Copy link

bgreni commented May 10, 2024

Review Mojo's priorities

What is your request?

Implement the bin() builtin function to convert integral values to a binary string representation.

fn main():
    print(bin(123)) # prints "0b1111011"

What is your motivation for this change?

This is a builtin function included in Python.
https://docs.python.org/3/library/functions.html#bin

Any other details?

No response

@bgreni bgreni added enhancement New feature or request mojo-repo Tag all issues with this label labels May 10, 2024
modularbot pushed a commit that referenced this issue May 18, 2024
[External] [stdlib] Add `bin()` builtin function

Fixes #2604

Implements the `bin()` builtin function from Python for converting
integral values to a binary string representation.

Co-authored-by: bgreni <[email protected]>
Closes #2603
MODULAR_ORIG_COMMIT_REV_ID: 96515ed124867bcac5a49781d57a92fae6bc480b
msaelices pushed a commit to msaelices/mojo that referenced this issue May 18, 2024
[External] [stdlib] Add `bin()` builtin function

Fixes modularml#2604

Implements the `bin()` builtin function from Python for converting
integral values to a binary string representation.

Co-authored-by: bgreni <[email protected]>
Closes modularml#2603
MODULAR_ORIG_COMMIT_REV_ID: 96515ed124867bcac5a49781d57a92fae6bc480b
@bgreni
Copy link
Author

bgreni commented May 21, 2024

Closed by #2603

@bgreni bgreni closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

1 participant