IssueRaiser

Probably best to stick to assembly for that, since the C version has lots of undefined behavior (division by zero is UB, as is bitwise sh...

Probably best to stick to assembly for that, since the C version has lots of undefined behavior (division by zero is UB, as is bitwise shift of a negative number) an optimizing compiler can do what it want with that code. :) I'm not trying to be annoying, but I think there's value in not publishing broken code without at least noting that it is broken. I realize that the code still communicates to humans how to compute signum(), but it's meaningless if compiled which is kind of important sometimes too.

Posted by unwind on Mar 2, 2015, 10:22 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.7,500 issues0 comments

reliability (Software)

Probably best to stick to assembly for that, since the C version has lots of undefined behavior (division by zero is UB, as is bitwise sh...

unwindMar 2, 2015, 10:22 AM

Probably best to stick to assembly for that, since the C version has lots of undefined behavior (division by zero is UB, as is bitwise shift of a negative number) an optimizing compiler can do what it want with that code. :) I'm not trying to be annoying, but I think there's value in not publishing broken code without at least noting that it is broken. I realize that the code still communicates to humans how to compute signum(), but it's meaningless if compiled which is kind of important sometimes too.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue