Timeline for Assembling a float from an array of bytes
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 25, 2015 at 20:21 | comment | added | UserK | Ok grazie prakharsingh95 | |
| Jun 25, 2015 at 14:58 | comment | added | xyz | @userk there is no assembly. Floats are already stored as bytes in memory. You are asking android to put the 4 most meaningful bytes in the buffer. Then you are trekking arduino to consider the bytes together as a float. If you are to store the same number in memory it week have the same representation. In a nutshell, this is an O(1) operation. | |
| Jun 19, 2015 at 19:02 | comment | added | Ignacio Vazquez-Abrams | @UserK: It will tell the compiler that the bytes it will be looking at are a float. | |
| Jun 19, 2015 at 19:02 | comment | added | UserK | Grazie Ignacio, so it will automatically assemble the sequence in a float variable? Nice | |
| Jun 19, 2015 at 19:01 | comment | added | Ignacio Vazquez-Abrams |
Right, otherwise it will advance sizeof(float) * 9 bytes instead.
|
|
| Jun 19, 2015 at 19:01 | history | edited | Ignacio Vazquez-Abrams | CC BY-SA 3.0 |
added 2 characters in body
|
| Jun 19, 2015 at 19:00 | comment | added | Edgar Bonet | This needs parentheses around “bufferBytes + 9”. | |
| Jun 19, 2015 at 18:59 | history | answered | Ignacio Vazquez-Abrams | CC BY-SA 3.0 |