How to convert BigInteger into binary?
Mostra commenti meno recenti
import java.math.*;
>> a=BigInteger('12362534624362643243256346523462');
>> b=toString(a);
>> dec2bin(b)
Error using dec2bin (line 24)
D must be numeric.
I have tried this
>> dec2bin(str2double(b))
ans = '10011100000010011000000011110110100110100000111111111000000000000000000000000000000000000000000000000000'
but it is not giving right output
The output should be
'10011100000010011000000011110110100110100000111111110111001000110111011110100110000110110011011101000110'
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Dates and Time in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!