# \#bitstring

**URL:** https://discourse.julialang.org/tag/bitstring/1219.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [How to convert a number to an hexadecimal \`bitstring\`?](https://discourse.julialang.org/t/how-to-convert-a-number-to-an-hexadecimal-bitstring/98673)

<div class="topic-metadata">

**Author:** [@tokujin](https://discourse.julialang.org/u/tokujin)\
**Replies:** 3\
**Last updated:** [May 11, 2023, 11:27am UTC](https://discourse.julialang.org/t/how-to-convert-a-number-to-an-hexadecimal-bitstring/98673 "2023-05-11T11:27:11Z")

</div>

I can do string(parse(Int, bitstring(x), base=2), base=16) to convert bitstring(x) to an hexadecimal string, but is there another way, one which is simpler and doesn’t trim the leading zeros off of integers?

---

## [How can I convert a bitstring to the binary form](https://discourse.julialang.org/t/how-can-i-convert-a-bitstring-to-the-binary-form/93134)

<div class="topic-metadata">

**Author:** [@dmtrung14](https://discourse.julialang.org/u/dmtrung14)\
**Replies:** 6\
**Last updated:** [January 18, 2023, 2:54pm UTC](https://discourse.julialang.org/t/how-can-i-convert-a-bitstring-to-the-binary-form/93134 "2023-01-18T14:54:22Z")

</div>

I am using bitstring to perform an xor operation on the ith bit of a string: string = bitstring(string ⊻ 1 \<\<i) However the result will be a string, so I cannot continue with other i. So I want to know how do I conver…

---

## [Inverse of bitstring(x)](https://discourse.julialang.org/t/inverse-of-bitstring-x/91032)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 4\
**Last updated:** [December 1, 2022, 4:25am UTC](https://discourse.julialang.org/t/inverse-of-bitstring-x/91032 "2022-12-01T04:25:29Z")

</div>

What function f is f(typeof(x), bitstring(x)) == x ?

---

## [Converting bitstring to number](https://discourse.julialang.org/t/converting-bitstring-to-number/12199)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 14\
**Last updated:** [February 13, 2022, 8:35am UTC](https://discourse.julialang.org/t/converting-bitstring-to-number/12199 "2022-02-13T08:35:14Z")

</div>

I know that if I have a litteral bitstring, I can convert it to an integer with Int(0b110101) Now, however, I would like to convert a bit string, either given as a tuple of 0 and 1, or as an actual string, to the corre…

---

## [Is the least significant bit from bitstring() correct?](https://discourse.julialang.org/t/is-the-least-significant-bit-from-bitstring-correct/74206)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 1\
**Last updated:** [January 7, 2022, 6:36pm UTC](https://discourse.julialang.org/t/is-the-least-significant-bit-from-bitstring-correct/74206 "2022-01-07T18:36:28Z")

</div>

I don’t know if this is a bug but it isn’t what I was expecting: julia\> bitstring(Float32(0.777777777777777777777777777777777777777777777777)) "00111111010001110001110001110010" julia\> bitstring(Float64(0.7777777777777…

---

## [What is the most efficient binary representation of unsigned integers in Julia?](https://discourse.julialang.org/t/what-is-the-most-efficient-binary-representation-of-unsigned-integers-in-julia/57465)

<div class="topic-metadata">

**Author:** [@Volker](https://discourse.julialang.org/u/Volker)\
**Replies:** 17\
**Last updated:** [March 22, 2021, 9:02pm UTC](https://discourse.julialang.org/t/what-is-the-most-efficient-binary-representation-of-unsigned-integers-in-julia/57465 "2021-03-22T21:02:50Z")

</div>

Hello everybody, I would like to know what is the most efficient binary representation in Julia? My use case is to convert an unsigned integer into a binary representation, then to mutate the elements of this binary rep…

---

## [How do I convert a binary string to a floating point number?](https://discourse.julialang.org/t/how-do-i-convert-a-binary-string-to-a-floating-point-number/21380)

<div class="topic-metadata">

**Author:** [@Alejandro](https://discourse.julialang.org/u/Alejandro)\
**Replies:** 3\
**Last updated:** [March 2, 2019, 4:03pm UTC](https://discourse.julialang.org/t/how-do-i-convert-a-binary-string-to-a-floating-point-number/21380 "2019-03-02T16:03:12Z")

</div>

Hello. I’ve been sort of away from Julia for a while and am wanting to get back into things, using version 1.01 (some things changed since 0.6, I see). Figured writing a simple genetic algorithm implementation for myself…
