[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

hexadecimal et printf



At 09:29 04/09/2002 +0200, Romuald DELAVERGNE wrote:
Le 2002.09.03 17:06, kamel a écrit :
Une question bête, comment faites-vous le calcul ?

Un moyen simple et rapide de faire des conversions hexadécimale <-> décimale à partir d'un shell:

 * printf "0x%X\n" nombreDecimal

là, ca marche :
aristote:~# printf "0x%X\n" 255
0xFF


 * printf "%d\n" nombreHexadecimal (précéder le nombre par 0x : 0xff par ex.)

là, ca ne marche pas tres bien
aristote:~# printf "%d\n" 0xff
bash: printf: 0xff: illegal number


C'était the tip of the day :-)

merci



--
To UNSUBSCRIBE, email to debian-user-french-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: