Skip to content

Conversation

@kobi2187
Copy link

@kobi2187 kobi2187 commented Oct 6, 2021

No description provided.

@guzba
Copy link
Collaborator

guzba commented Oct 9, 2021

The branch for 0 denominator slows down this proc without fixing any bugs (it returns the correct bool without the check).

@kobi2187
Copy link
Author

kobi2187 commented Oct 9, 2021

on my computer, the application, even demo examples crashes without this check.

@guzba
Copy link
Collaborator

guzba commented Oct 9, 2021

Hm, my Intel and AMD hardware, ARM M1 Mac, and all Github Actions on Mac Windows and Linux work. What is your hardware? Something must be different and it would be good to know what.

@treeform
Copy link
Owner

treeform commented Oct 9, 2021

Thank you for the issue. Could you provide a minimal example that causes this error, the compile flags you use and the nim -v of your install? We use this path a lot in pixie filling and have optimized it a ton, so we don't want to change it without evidence. If there is a real thing we will fix it.

@kobi2187
Copy link
Author

kobi2187 commented Oct 9, 2021

I understand your sentiment, but I repeatedly ran into it. if you put a doAssert on that line, you'll probably reach it sometimes.
I also get a lot of a one pixie error: unhandled exception: Image width and height must be > 0 [PixieError] So perhaps they are related issues.
I use Manjaro xfce as the linux distribution (maybe the window manager is the uncommon part). Happened on a regular AMD HP laptop, repeatedly.
Nim 1.5.1 (from choosenim devel)

The branch for 0 denominator slows down this proc without fixing any bugs

the branch for 0 denominator may happen. why not test that branch?
(and it's only a tiny if statement)
if both vector's x or y equals 0, you have a division by zero.
I cannot reproduce it right now (with the few minutes I have) but it definitely happened

@guzba
Copy link
Collaborator

guzba commented Oct 9, 2021

Ah, so, dividing by 0 is perfectly fine with floats. A bit more on this here: https://stackoverflow.com/questions/13110825/divide-by-zero-c-programming (It is not at all the same as integers.)

@guzba
Copy link
Collaborator

guzba commented Oct 9, 2021

width and height must be > 0 [PixieError]

That is different. I have updated the bumpy examples to use the latest pixie. What examples where you running that had that issue? These bumpy examples would not have compiled with the latest Pixie so I'm thinking it was something else. (see #14)

If it was the Fidget examples, those are probably locked to a very old version of Pixie and out of date. We're working on a new Fidget that is pretty different so those are probably not the best to look at right now unfortunately.

@guzba
Copy link
Collaborator

guzba commented Oct 9, 2021

(If it is Fidget examples, we could look at updating them, just noting that could explain the bad behavior.)

@treeform
Copy link
Owner

Sorry I am going to close this. We rely on the behavior of the divide by zero to produce the inf. Its part of float point standard.

Feel free to reopen if you can produce an example where there is a bug happens, and we will take a look at this again.

@treeform treeform closed this Oct 28, 2021
@kobi2187
Copy link
Author

kobi2187 commented Nov 1, 2021

sure thing. when I have more time, will try the examples again. There should be an easy nimble update all pkgs command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants