endianness Questions

4

Solved

I am receiving and sending a decimal representation of two little endian numbers. I would like to: shift one variable 8 bits left OR them shift a variable number of bits create 2 8 bit numbers re...
Neuropath asked 16/3, 2011 at 2:37

29

Is there a programmatic way to detect whether or not you are on a big-endian or little-endian architecture? I need to be able to write code that will execute on an Intel or PPC system and use exact...
Previse asked 16/6, 2009 at 12:56

3

Solved

I'm writing and reading binary data (std::ios::binary) in C++ using std::fstream - this includes integer and floating point values. While my code works on my own architecture, I wan't to make sure,...
Countersignature asked 3/3, 2016 at 5:19

1

Solved

I recently wrote some code that uses memcpy to unpack float/double to unsigned integers of the appropriate width, and then uses some bit-shifting to separate the sign bit from the combined signific...
Feck asked 31/7, 2022 at 20:0

7

Solved

I'm using WebGL to render a binary encoded mesh file. The binary file is written out in big-endian format (I can verify this by opening the file in a hex editor, or viewing the network traffic usin...
Neille asked 23/10, 2011 at 22:37

9

Solved

A common question that comes up from time to time in the world of C++ programming is compile-time determination of endianness. Usually this is done with barely portable #ifdefs. But does the C++11 ...
Nairn asked 18/10, 2009 at 2:1

3

Solved

I have to determine if the mars simulator is big or little endian as homework, this seems pretty straightforward at first, but I am having some issues. First I tried storing 4 bytes in memory with...
His asked 2/10, 2017 at 20:41

3

Solved

How to write a constexpr function to swap endianess of an integer, without relying on compiler extensions and can you give an example on how to do it?
Mannes asked 29/4, 2016 at 11:0

3

Solved

I understand bitmap layout and pixel format subject pretty well, but getting an issue when working with png / jpeg images loaded through NSImage – I can't figure out if what I get is the intended b...
Proconsul asked 4/9, 2016 at 19:1

9

What is the difference between the following types of endianness? byte (8b) invariant big and little endianness half-word (16b) invariant big and little endianness word (32b) invariant big and li...
Isobaric asked 21/8, 2008 at 23:42

9

Solved

I'm going though a computers system course and I'm trying to establish, for sure, if my AMD based computer is a little-endian machine? I believe it is because it would be Intel-compatible. Specific...
Averroes asked 21/6, 2009 at 23:0

2

Solved

Since big-endian and little-endian have to do with byte order, and since one u8 is one byte, wouldn't u8::from_be_bytes and u8::from_le_bytes always have the same behavior?
Chick asked 31/1, 2022 at 15:23

9

Solved

I ask because I am sending a byte stream from a C process to Java. On the C side the 32 bit integer has the LSB is the first byte and MSB is the 4th byte. So my question is: On the Java side when ...
Naashom asked 12/12, 2008 at 10:21

1

Solved

Does the new M1 Max ARM Chip use little endian or big endian to store hex?
Emanuele asked 2/12, 2021 at 17:7

4

Solved

I need to read data from serial port. They are in little endian, but I need to do it platform independent, so I have to cover the endianness of double. I couldn't find anywhere, how to do it, so I ...
Rattlesnake asked 8/4, 2016 at 11:12

2

Solved

I have problem. I use sqlite to store sounds. I get sound from it in byte[]. Then convert byte[] to float[]: private float[] ConvertByteToFloat(byte[] array) { float[] floatArr = new float[arr...
Translatable asked 18/4, 2013 at 8:40

2

Solved

Despite a common definition for word (as stated on Wikipedia) being: The largest possible address size, used to designate a location in memory, is typically a hardware word (here, "hardware w...
Painting asked 2/7, 2021 at 18:3

7

Solved

How can I test or check C++ code for endian-independence? It's already implemented, I would just like to verify that it works on both little- and big-endian platforms. I could write unit tests and...
Yvette asked 20/6, 2011 at 14:24

3

Solved

I have a byte array, which originally was converted from a float array in Scala. I need to convert it back to a float array in Python. This is the code I used to convert the float array in Scala: ...
Philine asked 31/5, 2019 at 13:59

3

Solved

I'd like to be able to copy big endian float arrays directly from an unaligned network buffer into a std::vector<float> and perform the byte swapping back to host order "in place", ...
Tungus asked 26/1, 2021 at 23:31

1

The regular Matrix representation of a CNOT gate as found in literature is: CNOT = \begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 &...
Mason asked 21/1, 2021 at 18:24

2

If I run the following code: Uint8List bytes = Uint8List.fromList([1, 0, 0, 128]); ByteBuffer byteBuffer = bytes.buffer; Uint16List sixteenBitList = byteBuffer.asUint16List(); print(sixteenBitList)...
Spectator asked 20/12, 2020 at 2:54

2

Solved

I am very confused. I need to read binary files (.fsa extension by Applied Biotechnology aka ABIF, FASTA files) and I ran into a problem reading signed integers. I am doing everything according to ...
Bomke asked 25/11, 2020 at 12:48

2

Solved

I want to reverse the packing of the following code: struct.pack("<"+"I"*elements, *self.buf[:elements]) I know "<" means little endian and "I" is uns...
Stipulate asked 14/10, 2020 at 22:22

5

Solved

I have some bytearray with length of 2*n: a1 a2 b1 b2 c1 c2 I need to switch bytes endian in each 2-byte word, and make: a2 a1 b2 b1 c2 c1 Now I use next approach but it is very slow for my t...
Occupant asked 19/3, 2016 at 0:12

© 2022 - 2024 — McMap. All rights reserved.