zsh-users
 help / color / mirror / code / Atom feed
* Determining the length of "long"?
@ 2014-09-11 21:36 Dominik Vogt
  2014-09-12  2:58 ` Kurtis Rader
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Dominik Vogt @ 2014-09-11 21:36 UTC (permalink / raw)
  To: Zsh Users

Is there a way to determine the length of the C type long from
inside a zsh script (without using external programs, of course).

As an alternative, is there a direct way to print out a "long"
integer value as binary bytes in host byte order?

I.e. given a value, say 0x12345, I need to print that as

  \\x00\\x01\\x23\\x45

on a 32 bit platform, and as

  \\x00\\x00\\x00\\x00\\x00\\x01\\x23\\x45

on a 64 bit platform (possibly in reverse byte order, depending on
the hardware).

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-09-13  0:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11 21:36 Determining the length of "long"? Dominik Vogt
2014-09-12  2:58 ` Kurtis Rader
2014-09-12  4:39 ` Bart Schaefer
2014-09-12  8:42   ` Dominik Vogt
2014-09-12 13:17     ` Kurtis Rader
2014-09-12 23:16     ` Bart Schaefer
2014-09-12 23:42       ` Dominik Vogt
2014-09-13  0:17         ` Bart Schaefer
2014-09-12  8:51   ` Peter Stephenson
2014-09-12 16:17 ` Roman Neuhauser
2014-09-12 17:04   ` Dominik Vogt
2014-09-12 18:10     ` Roman Neuhauser
2014-09-12 18:50       ` Dominik Vogt

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).