convert base-10 number to a base-2 number in string form
String(number, lsbfirst, options)
String(number, msbfirst, options)
a nonnegative integer
literal indicating string should have the least significant bit first
literal indicating string should have the most significant bit first
The String command converts the input number to a base-2 string, by default in least-to-most significant bit order. Specification of the option msbfirst reverses the order in the output string to most-to-least significant bit order.
The most common usage of this command would be for conversion of a number into a string of its base-2 digits.
The Split command is closely related, but the output for that command is a list of integers.
The option bits=n tells String how many bits to consider in the conversion. Any bits in a higher position are simply ignored.
The number of bits can also be set via Settings.
lsbfirst is the default
msbfirst reverses the order
Truncate at bit 8
Download Help Document
What kind of issue would you like to report? (Optional)
Thank you for submitting feedback on this help document. Your feedback will be used
to improve Maple's help in the future.