[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 Iain Buclaw changed: What|Removed |Added Priority|P3 |P2 --

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 --- Comment #12 from mw --- for the additional reference, the forum discussion is here: https://forum.dlang.org/thread/rdrqedmbknwrppbfi...@forum.dlang.org Now both Java and C# did it more correct than D. """ At least I want a warning message,

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 --- Comment #11 from kinke --- FWIW, in C# this is an error: long a = -5000; ulong b = 2; long c = a / b; // Operator '/' is ambiguous on operands of type 'long' and 'ulong' --

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 kinke changed: What|Removed |Added Keywords|wrong-code |spec Hardware|x86_64

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 Basile-z changed: What|Removed |Added Keywords||wrong-code --- Comment #9 from Basile-z ---

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 --- Comment #8 from mw --- $ /mnt/c/project/dmd2/windows/bin64/dmd.exe --version DMD64 D Compiler v2.092.0-dirty Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved written by Walter Bright --

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 --- Comment #7 from kinke --- (In reply to mw from comment #2) > BTW, on Windows, dmd correctly output -2500. Not on Windows, but for 32-bit targets, as an unsigned 32-bit int is converted to a signed 64-bit long in that case, according to spec

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 --- Comment #6 from mw --- OK, let me write this in this way to show it's impact: == import std.algorithm; import std.stdio; void main() { long[] a = [-5000, 0]; long c = sum(a) / a.length; writeln(c); }

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 Basile-z changed: What|Removed |Added CC||b2.t...@gmx.com --- Comment #5 from Basile-z

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 FeepingCreature changed: What|Removed |Added CC||default_357-l...@yahoo.de --- Comment #4

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 --- Comment #3 from mw --- Just because C++ did it doesn't means it's correct. And D supposed to be an improvement of C++. --

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 mw changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 --- Comment #2 from mw --- It can NOT silently do this, at least a warning. BTW, on Windows, dmd correctly output -2500. --

[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308

2020-08-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21151 kinke changed: What|Removed |Added Status|NEW |RESOLVED CC|