[L2Ork-dev] PD_BIGORSMALL

Matt Barber brbrofsvl at gmail.com
Mon May 21 12:45:25 EDT 2018


On Sun, May 20, 2018 at 10:44 PM, Jonathan Wilkes <jon.w.wilkes at gmail.com>
wrote:

> On Sun, May 13, 2018 at 7:02 PM, Jonathan Wilkes <jon.w.wilkes at gmail.com>
> wrote:
> > On Sun, May 13, 2018 at 3:39 PM, Matt Barber <brbrofsvl at gmail.com>
> wrote:
> >> Much of that is already taken care of in m_pd.h
> >
> > Ha! I forgot to search for it before asking that.
> >
> > Ok, int32_t sounds like the way to go then.
>
> A few more questions:
>
> 1. Shouldn't it be uint32_t? Does the right shift make any difference given
> we're not caring about the sign in this test? Will that trigger evil
> compilers
> to format the harddrive? (Not sure what is defined behavior wrt to ints...)
>

​Yes, uint32_t is best for any kind of type punning.​



>
> 2. The comment next to PD_BADFLOAT:
> // test for NANs, infs and denormals
>
> But that test is only for NANs and INFs, no?
>

​Yes only NaN and INF.​



>
> 3. Comment for PD_BIGORSMALL:
>  // > abs(2^64) or < abs(2^-64)
>
> But those are off by one-- it should be:
> // > abs(2^65) or < abs(2^-63)
>
> Isn't that correct given the way the exponent bias works on IEEE 754
> floats?
>

​Yes.​ PD_BIGORSMALL is true if both the first two exponent bits are set or
both are unset, so technically abs(f) >= 2^65 or abs(f) < 2^-63


>
> 4. Just curious-- why the choice of 0x20000000 for the cutoff?
>

​Because it's very fast and gets a reasonable range for high and low that
are roughly inverse magnitude.​



>
> Thanks,
> Jonathan
> _______________________________________________
> L2Ork-dev mailing list
> L2Ork-dev at disis.music.vt.edu
> https://disis.music.vt.edu/listinfo/l2ork-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://disis.music.vt.edu/pipermail/l2ork-dev/attachments/20180521/aa44d06d/attachment.html>


More information about the L2Ork-dev mailing list