[DiscordArchive] Does anybody have any idea how that can be read/written from python?
[DiscordArchive] Does anybody have any idea how that can be read/written from python?
Archived author: Skarn • Posted: 2018-06-03T20:04:35.779000+00:00
Original source
Does anybody have any idea how that can be read/written from python?
Archived author: Skarn • Posted: 2018-06-03T20:04:40.436000+00:00
Original source
```py
A fixed point real number, opposed to a floating point.
template<typename Base, size_t integer_bits, size_t decimal_bits> struct fixed_point
{
Base decimal : decimal_bits;
Base integer : integer_bits;
Base sign : 1;
float to_float() const { return (sign ? -1.0f : 1.0f) * (integer + decimal / float (1 << decimal_bits)); }
};
```
Archived author: Skarn • Posted: 2018-06-03T20:05:13.066000+00:00
Original source
I realize I need to use bitwise operators, but I am confused how I can read the integer_bits in the middle
Archived author: Skarn • Posted: 2018-06-03T20:05:24.661000+00:00
Original source
and I am even more confused when it comes to converting a float to that
Archived author: Skarn • Posted: 2018-06-03T20:05:36.787000+00:00
Original source
(yeah, I suck a lot at bitwise things)
Archived author: Skarn • Posted: 2018-06-03T20:06:25.274000+00:00
Original source
<@309386531699687425> are you reading fixed point stuff in C#?
Archived author: Zee • Posted: 2018-06-03T20:09:29.943000+00:00
Original source
I never used that before.
Archived author: Skarn • Posted: 2018-06-03T20:10:25.938000+00:00
Original source
<@309386531699687425> you are not parsing color animations and such yet?
Archived author: Zee • Posted: 2018-06-03T20:10:42.661000+00:00
Original source
Not yet no.
Archived author: schlumpf • Posted: 2018-06-03T20:14:16.737000+00:00
Original source
Make bit masks per field with #bits set. Shift left by sum of previous field sites. Binary-and. Shift back. Done.