« first day (559 days earlier)      last day (2300 days later) » 

9:55 AM
25
A: What's the difference between “mod” and “remainder”?

chux Does '%' mean either "mod" or "rem" in C? In C, % is the remainder. ..., the result of the / operator is the algebraic quotient with any fractional part discarded ... (This is often called "truncation toward zero".) C11dr §6.5.5 6 The operands of the % operator shall have integer ty...

// m += (b < 0) ? -b : b; // avoid this form: it is UB when b == INT_MIN
Question: why is this UB?
@LXSoft and everyone who doesn't do this:
May 5 '17 at 13:07, by milleniumbug
user image
May 5 '17 at 13:41, by Szymon Marczak
user image
Also you can press CTRL+K
 
 
1 hour later…
11:28 AM
@dud3, hey, do you want to ask a question about C++ related problem?
I just thought that you might be thinking that the room is dead
 
12:05 PM
@SzymonMarczak If an math operator used in signed integer type results in a value which is outside of the range that the type can represent, it's undefined behaviour
And in two complement's signed integer representation (which isn't mandated by C++, but it's the most common one), the smallest value doesn't have an absolute value which can be represented
(i.e. the range of 16 bit signed integer type which uses two's complement is -32768..32767)
 
 
2 hours later…
1:49 PM
@milleniumbug Ok, now I get it. -INT16_MIN = INT16_MAX + 1 - this is outside of that range.
 
 
3 hours later…
5:02 PM
Is this the right room to ask about CMake?
 
18 hours ago, by milleniumbug
shoot away, the worst thing that could happen is that you won't get an answer
 
I'm trying to figure out how to incorporate an external project. Works fine when I do it manually. It's just a git pull, then run a script inside the pulled code. When I try to put that script into External_Project_Add under BUILD_COMMAND, it says it's not there. But I can see it.
The code I'm interested in is github.com/real-logic/aeron.git and the command I need to build is "./cppbuild/cppbuild -b"
So I would have thought all that was needed was to specify the git, where to put the pulled code, and then run the script with the -b argument.
 
 
2 hours later…
7:33 PM
Could somone take a look if this last edit is valid: stackoverflow.com/posts/29685129/revisions ? In my opinion the return type in this lambda is not required (but I don't have enough reputation to revert it)
 
@AdamF You are the author, so you are completely free to revert it. The return type on the lambda is not required. If that edit was in the suggested edit queue, I would have rejected it
 
user4651282
^++
 
If there's no "rollback" button, you can look at the revisions, and click the "edit" on a prior revision to edit from that state.
 
8:09 PM
ok thanks for help. I have followed Justin hint.
 

« first day (559 days earlier)      last day (2300 days later) »