LogFAQs > #979564274

LurkerFAQs, Active Database ( 12.01.2023-present ), DB1, DB2, DB3, DB4, DB5, DB6, DB7, DB8, DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
TopicWriting an NES emulator ama
Sahuagin
03/25/24 10:55:29 PM
#24:


I don't think what you've said about floats and bools is correct. floats are 4 bytes/32 bits. doubles are 8 bytes/64 bits.

bools are in many places 4 bytes/32 bits, except in arrays they are 1 byte (each).

I don't have a hexdump of memory to confirm this, but some quick tests do seem to confirm it: https://ideone.com/4ELLjh

Size of a single Single in bytes is 4.
Size of a single Double in bytes is 8.
Size of a single Boolean in bytes is 4.
An array of type Single of size 5 takes up 20 bytes.
An array of type Double of size 5 takes up 40 bytes.
An array of type Boolean of size 5 takes up 5 bytes.

---
This day is gone. We can't relive it. It's gone forever.
... Copied to Clipboard!
Topic List
Page List: 1