Bug 19027 – iota(int.min, int.max).length is incorrect

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2018-06-26T04:06:25Z
Last change time
2024-12-01T16:34:00Z
Keywords
pull
Assigned to
No Owner
Creator
David Bennett
Moved to GitHub: phobos#10344 →

Comments

Comment #0 by davidbennett — 2018-06-26T04:06:25Z
--- void main() { import std.range : iota; import std.conv : to; auto length = iota(int.min, int.max).length; assert(length == uint.max, "opps... length is " ~ length.to!string); } --- fails with: core.exception.AssertError@[snip]: opps... length is 18446744073709551615 ---------------- ??:? _d_assert_msg [0x18578d52] ??:? _Dmain [0x1855e6cc] I iota seems work fine with byte, short and long, it's just int that has issues. Thanks, David
Comment #1 by greeenify — 2018-06-26T06:18:04Z
Comment #2 by robert.schadek — 2024-12-01T16:34:00Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10344 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB