Re: need help to work around float union non-zero init

2024-09-23 Thread Dakota via Digitalmars-d-learn
On Friday, 20 September 2024 at 16:21:10 UTC, Nick Treleaven wrote: On Friday, 20 September 2024 at 09:38:54 UTC, Dakota wrote: Thanks to Dennis for the workaround. Thanks your all for the tips, void solution fix me problem.

Re: mod of negative number

2024-09-23 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, September 23, 2024 1:52:02 PM MDT Craig Dillabaugh via Digitalmars- d-learn wrote: > Why does the following program: > > \ > import std.stdio; > > int main(string[] args) { > uint Q = 7681; > writeln("Val = ", -1 % Q); > retur

Re: mod of negative number

2024-09-23 Thread Craig Dillabaugh via Digitalmars-d-learn
On Monday, 23 September 2024 at 20:02:25 UTC, Craig Dillabaugh wrote: On Monday, 23 September 2024 at 19:52:02 UTC, Craig Dillabaugh wrote: Why does the following program: snip Opps, sorry. I was expecting 7680 (not -1 or 5568). After a bit of research I see this is the same behavior as C,

Re: mod of negative number

2024-09-23 Thread Craig Dillabaugh 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