-
Notifications
You must be signed in to change notification settings - Fork 2
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
add idiom 308 Integer to string in base b #158
add idiom 308 Integer to string in base b #158
Conversation
Is the output unambiguous? Or would something like "decimal 2 is 10 in base 2" be better? |
@@ -0,0 +1,29 @@ | |||
ex308 is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have
# convert this to a number using the given base. If negative, add "-" as
# the first character.
#
public as_string(base u32) String : character_encodings
in stdlib. Did you see this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no 🙈
It doesn't work for 0 in base 999999 but I guess this is rarely needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For base 999999 you would first need 999999 symbols. So no this is useless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, I just thought it would be a nice (but probably useless) optimization, because 0 is the same in every base.
No description provided.