# Re: converting binary string into integer

4 messages
Open this post in threaded view
|
Report Content as Inappropriate

## Re: converting binary string into integer

 Hi guys,Now that `parseint()` got removed for version 0.5, Is `parse()` the only way to do this? How could I parse binary into a BigInt? More specifically, I want to see the integer number of the arecibo message. (73x23 so 1679 binary digits into a big int)
Open this post in threaded view
|
Report Content as Inappropriate

## Re: converting binary string into integer

 Le dimanche 06 novembre 2016 à 10:13 -0800, Alberto Barradas a écrit : > Hi guys, > Now that `parseint()` got removed for version 0.5, Is `parse()` the > only way to do this? >  How could I parse binary into a BigInt? More specifically, I want to > see the integer number of the arecibo message. (73x23 so 1679 binary > digits into a big int) parse() is meant to be called on Julia expressions. Use parse(Int, ...) or parse(BigInt, ...) depending on your needs. Regards
Open this post in threaded view
|
Report Content as Inappropriate

## Re: converting binary string into integer

 In reply to this post by Alberto Barradas El domingo, 6 de noviembre de 2016, 15:18:03 (UTC-5), Alberto Barradas escribió:Hi guys,Now that `parseint()` got removed for version 0.5, Is `parse()` the only way to do this? How could I parse binary into a BigInt? More specifically, I want to see the integer number of the arecibo message. (73x23 so 1679 binary digits into a big int)julia> s = join(rand(0:1, 64))"1001011000111000000010011110001010010001111110100101001111100111"julia> parse(Int64, s, 2)------ OverflowError ------------------- Stacktrace (most recent call last)julia> parse(BigInt, s, 2)   # the 2 at the end is the base (here, binary)10824412573101347815