![]() Just keep in mind that's a generic bit of pseudo-code which may not be the most efficient way of doing it though, with the iterations you seem to be proposing, it won't make much difference. Which will construct your binary string based on the decimal value. Such as, for example, the pseudo-code: define intToBinString, receiving intVal: ![]() If you're working in an environment that doesn't provide exactly what you need, you should be collecting snippets of code as you develop to ensure you never have to write the same thing twice. Python actually does have something already built in for this, the ability to do operations such as ''.format(42), which will give you the bit pattern (in a string) for 42, or 101010.įor a more general philosophy, no language or library will give its user base everything that they desire.
0 Comments
Leave a Reply. |