Forums WoW Modding Support Archives WoWModding Support Archives [DiscordArchive] <@250706991515828224> what do you mean by multiplying by 2-n?

[DiscordArchive] <@250706991515828224> what do you mean by multiplying by 2-n?

[DiscordArchive] <@250706991515828224> what do you mean by multiplying by 2-n?

Pages (2): Previous 1 2
rektbyfaith
Administrator
0
06-04-2018, 08:30 AM
#11
Archived author: Skarn • Posted: 2018-06-04T08:30:24.161000+00:00
Original source

Looks weird to me, decimal part is not used
rektbyfaith
06-04-2018, 08:30 AM #11

Archived author: Skarn • Posted: 2018-06-04T08:30:24.161000+00:00
Original source

Looks weird to me, decimal part is not used

rektbyfaith
Administrator
0
06-04-2018, 08:30 AM
#12
Archived author: Quantam • Posted: 2018-06-04T08:30:42.598000+00:00
Original source

There's only one part, really (unless they're doing something super abnormal)
rektbyfaith
06-04-2018, 08:30 AM #12

Archived author: Quantam • Posted: 2018-06-04T08:30:42.598000+00:00
Original source

There's only one part, really (unless they're doing something super abnormal)

rektbyfaith
Administrator
0
06-04-2018, 08:30 AM
#13
Archived author: Quantam • Posted: 2018-06-04T08:30:51.969000+00:00
Original source

You're just shifting the binary decimal point
rektbyfaith
06-04-2018, 08:30 AM #13

Archived author: Quantam • Posted: 2018-06-04T08:30:51.969000+00:00
Original source

You're just shifting the binary decimal point

rektbyfaith
Administrator
0
06-04-2018, 08:31 AM
#14
Archived author: schlumpf • Posted: 2018-06-04T08:31:19.689000+00:00
Original source

<@197724887387734016> if you look closely it is only off by one due to rounding
rektbyfaith
06-04-2018, 08:31 AM #14

Archived author: schlumpf • Posted: 2018-06-04T08:31:19.689000+00:00
Original source

<@197724887387734016> if you look closely it is only off by one due to rounding

rektbyfaith
Administrator
0
06-04-2018, 08:31 AM
#15
Archived author: Skarn • Posted: 2018-06-04T08:31:47.890000+00:00
Original source

```py
integral_part = (fixed_point_val >> self.dec_bits) & (1 << self.int_bits) - 1
sign = -1.0 if (fixed_point_val & (1 << (self.dec_bits + self.int_bits)) != 0) else 1.0

self.value = sign * float(integral_part) * 2**-self.dec_bits
```
rektbyfaith
06-04-2018, 08:31 AM #15

Archived author: Skarn • Posted: 2018-06-04T08:31:47.890000+00:00
Original source

```py
integral_part = (fixed_point_val >> self.dec_bits) & (1 << self.int_bits) - 1
sign = -1.0 if (fixed_point_val & (1 << (self.dec_bits + self.int_bits)) != 0) else 1.0

self.value = sign * float(integral_part) * 2**-self.dec_bits
```

rektbyfaith
Administrator
0
06-04-2018, 08:31 AM
#16
Archived author: Skarn • Posted: 2018-06-04T08:31:55.279000+00:00
Original source

is that correct for reading?
rektbyfaith
06-04-2018, 08:31 AM #16

Archived author: Skarn • Posted: 2018-06-04T08:31:55.279000+00:00
Original source

is that correct for reading?

rektbyfaith
Administrator
0
06-04-2018, 08:32 AM
#17
Archived author: Deleted User • Posted: 2018-06-04T08:32:33.045000+00:00
Original source

I use my bitshift stuff and it seems to work good enough
rektbyfaith
06-04-2018, 08:32 AM #17

Archived author: Deleted User • Posted: 2018-06-04T08:32:33.045000+00:00
Original source

I use my bitshift stuff and it seems to work good enough

rektbyfaith
Administrator
0
06-04-2018, 08:32 AM
#18
Archived author: Quantam • Posted: 2018-06-04T08:32:36.049000+00:00
Original source

My suspicion is that there is no sign bit either (it's two's complement), but without values to check I have no proof of that
rektbyfaith
06-04-2018, 08:32 AM #18

Archived author: Quantam • Posted: 2018-06-04T08:32:36.049000+00:00
Original source

My suspicion is that there is no sign bit either (it's two's complement), but without values to check I have no proof of that

rektbyfaith
Administrator
0
06-04-2018, 08:33 AM
#19
Archived author: Skarn • Posted: 2018-06-04T08:33:31.511000+00:00
Original source

32767
rektbyfaith
06-04-2018, 08:33 AM #19

Archived author: Skarn • Posted: 2018-06-04T08:33:31.511000+00:00
Original source

32767

rektbyfaith
Administrator
0
06-04-2018, 08:33 AM
#20
Archived author: Skarn • Posted: 2018-06-04T08:33:39.550000+00:00
Original source

is the default value for transparency
rektbyfaith
06-04-2018, 08:33 AM #20

Archived author: Skarn • Posted: 2018-06-04T08:33:39.550000+00:00
Original source

is the default value for transparency

Pages (2): Previous 1 2
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)