Re: mod of negative number

2024-09-24 Thread Timon Gehr via Digitalmars-d-learn
On 9/23/24 21:52, Craig Dillabaugh wrote: Why does the following program:     \     import std.stdio;     int main(string[] args) {     uint Q = 7681;     writeln("Val = ", -1 % Q);     return 0;     }     \     Print     Val = 5568 Was hopin

Split by top level comma

2024-09-24 Thread monkyyy via Digitalmars-d-learn
I *strongly* believe the answer is not reasonable using phoboes tools; but Im going to leave it as an open question before I get started on something from scratch. Given well compliant phoboes-style ranges and a `ref string or retro!string` that starts with '(',')','[',']','{','}', modify tha

Re: mod of negative number

2024-09-24 Thread Sergey via Digitalmars-d-learn
On Monday, 23 September 2024 at 19:52:02 UTC, Craig Dillabaugh wrote: Why does the following program: \ import std.stdio; int main(string[] args) { uint Q = 7681; writeln("Val = ", -1 % Q); return 0; } \ Print Val