Search found 80 matches

by Slidy
October 4th, 2020, 8:01 am
Forum: Everything
Topic: SIMD library attempt inf
Replies: 25
Views: 17341

Re: SIMD library attempt inf

albinopapa wrote:
October 2nd, 2020, 12:08 am
Found some resources for helping learn how to compile my own language, but does anyone else have troubles translating example code to your own code?
Experienced that a lot with rastertek.

For making your own language, can highly recommend https://craftinginterpreters.com/
by Slidy
August 29th, 2020, 7:06 am
Forum: Everything
Topic: Checking for NaN
Replies: 11
Views: 6330

Re: Checking for NaN

Aside from std::nan() and the std::numeric_limits functions, how would you even getting a nan as a result? I tried dividing by 0.0 and end up getting inf. Doing 0/0 should work. double zero = 0.0f; x.f = zero / zero; Tried it out and it gave me "-NaN" as a result. Since it's negative it has sign bi...
by Slidy
August 28th, 2020, 6:45 pm
Forum: Everything
Topic: Checking for NaN
Replies: 11
Views: 6330

Re: Checking for NaN

Okay, tested using your main() code and my is_nan() function. IsNaN: 1 MyIsNaN: 1 (sign=0, exponent=2047, mantissa=2251799813685248) IsNaN: 1 MyIsNaN: 1 (sign=0, exponent=2047, mantissa=2251799813685248) Don't think that was my exact code you tested, you're testing the same mantissa twice. In my te...
by Slidy
August 28th, 2020, 12:23 pm
Forum: Everything
Topic: Checking for NaN
Replies: 11
Views: 6330

Re: Checking for NaN

This doesn't work either. As I mentioned, since the mantissa bits can be anything while still being considered NaN you can't just do a direct compare. One workaround might be to mask out the mantissa/sign bits before doing a compare.
by Slidy
August 28th, 2020, 5:16 am
Forum: Everything
Topic: Checking for NaN
Replies: 11
Views: 6330

Re: Checking for NaN

I don't think this works properly. Test case: constexpr bool my_is_nan( T x )noexcept { using integer_type = std::conditional_t<std::is_same_v<T, float>, std::uint32_t, std::uint64_t>; constexpr auto qnan = std::bit_cast<integer_type, T>(std::numeric_limits<float>::quiet_NaN()); constexpr auto snan ...
by Slidy
August 24th, 2020, 12:04 pm
Forum: Everything
Topic: Quadtree progress
Replies: 16
Views: 8349

Re: Quadtree progress

Ah I see what you mean, you are right. I'll fix that later, although I don't think I'm using the move assignment on a pre-existing allocator anywhere so not too pressing an issue.

Thanks.
by Slidy
August 24th, 2020, 2:56 am
Forum: Everything
Topic: Quadtree progress
Replies: 16
Views: 8349

Re: Quadtree progress

Thanks for the suggestions. I don't see the leak you're talking about. m_pChunks is an std::vector so std:move should take care of anything (in fact don't think the explicit move constructor/assignment is really needed, it's probably a remnant of older code). As for your other points, they're not wr...
by Slidy
August 21st, 2020, 5:31 pm
Forum: Everything
Topic: Quadtree progress
Replies: 16
Views: 8349

Re: Quadtree progress

Few ways to get around this. Simplest is using linked list which you mentioned. Another option is to make a chunked allocator. Rather than allocating one big blob of memory and moving all the old data, you would allocate in fixed chunks. So once you run out of memory you create a new chunk for the n...
by Slidy
August 16th, 2020, 3:38 am
Forum: Everything
Topic: Looking for advice (DX vs. OpenGL)
Replies: 2
Views: 2658

Re: Looking for advice (DX vs. OpenGL)

Graphics APIs have evolved over the years, giving more and more power, and therefore responsibility, to the user. It used to be that you just tell the API to "draw this thing" and it'd do it for you, but that doesn't really give you much control over how things get drawn on the screen. With more con...
by Slidy
August 16th, 2020, 3:21 am
Forum: Everything
Topic: Chili, help a brother out.
Replies: 3
Views: 2815

Re: Chili, help a brother out.

Projects that are relevant to the place you are applying to probably have a better chance of being effective. e.g. if you want to get into web dev showing them a website you made (or similar web related project) would be the best way to showcase your skills. As for showing git competency & working w...