Re: Is there any implementation of a 128bit integer?
On Monday, 11 July 2022 at 02:49:52 UTC, Steven Schveighoffer wrote: So here is what happened: 1. User found an old thread (2019) asking if there was a 128-bit integer. 2. User noticed that there's a new implementation for 128-bit integers. 3. User replied to the thread indicating that there is an actual implementation now. 4. D forum software prompted user to create a new thread because it's really old. 5. The post you see above. Steven is right, it's actually a vicious circle! Because as long as we can't add 1 to ulong.max effortlessly (I guess it's called front end?), these discussions will continue... SDB@79
Re: Is there any implementation of a 128bit integer?
On 7/10/22 8:19 PM, Era Scarecrow wrote: On Friday, 8 July 2022 at 15:32:44 UTC, Rob T wrote: https://forum.dlang.org/post/mailman.10914.1566237225.29801.digitalmars-d-le...@puremagic.com In case someone comes across this old thread https://dlang.org/phobos/core_int128.html There was a discussion on this not long ago. Walter tried implementing it recently too, though I'm guessing he gave up. https://forum.dlang.org/thread/wuiurmxvqjcuybfip...@forum.dlang.org There's multiple libraries, one of which i wrote which tries to address this issue. One thing you can try doing is using BigInt, and then reducing to 128bit if/when you need to store the result. Apparently a number of compilers and back-ends already know how to handle 128bit types (*and maybe larger*), but it's a matter of just putting it in the D frontend so it generates the appropriate calls. https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.d https://github.com/rtcvb32/Side-Projects/tree/master/arbitraryint So here is what happened: 1. User found an old thread (2019) asking if there was a 128-bit integer. 2. User noticed that there's a new implementation for 128-bit integers. 3. User replied to the thread indicating that there is an actual implementation now. 4. D forum software prompted user to create a new thread because it's really old. 5. The post you see above. Now, this is one *actual use case* where I think it's correct to resurrect a 3-year-old thread. Because the new reply actually isn't connected to the old thread at all, except by reference in the new thread. So someone finding the old thread will *not* see this reply unless they also search for any newer replies. It makes me wonder, when you reply to an old thread and the forum software suggests instead to create a new thread referencing the old thread, if the forum software shouldn't put a link in the old thread to the new thread so those who find the old thread see there are newer replies to it? -Steve
Re: Is there any implementation of a 128bit integer?
On Monday, 11 July 2022 at 00:19:23 UTC, Era Scarecrow wrote: On Friday, 8 July 2022 at 15:32:44 UTC, Rob T wrote: [...] There was a discussion on this not long ago. Walter tried implementing it recently too, though I'm guessing he gave up. [...] Note that you're replying to a message containing a link to the implementation that is in the standard library today.
Re: Is there any implementation of a 128bit integer?
On Friday, 8 July 2022 at 15:32:44 UTC, Rob T wrote: https://forum.dlang.org/post/mailman.10914.1566237225.29801.digitalmars-d-le...@puremagic.com In case someone comes across this old thread https://dlang.org/phobos/core_int128.html There was a discussion on this not long ago. Walter tried implementing it recently too, though I'm guessing he gave up. https://forum.dlang.org/thread/wuiurmxvqjcuybfip...@forum.dlang.org There's multiple libraries, one of which i wrote which tries to address this issue. One thing you can try doing is using BigInt, and then reducing to 128bit if/when you need to store the result. Apparently a number of compilers and back-ends already know how to handle 128bit types (*and maybe larger*), but it's a matter of just putting it in the D frontend so it generates the appropriate calls. https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.d https://github.com/rtcvb32/Side-Projects/tree/master/arbitraryint
Is there any implementation of a 128bit integer?
https://forum.dlang.org/post/mailman.10914.1566237225.29801.digitalmars-d-le...@puremagic.com In case someone comes across this old thread https://dlang.org/phobos/core_int128.html
Re: Is there any implementation of a 128bit integer?
On Monday, August 19, 2019 11:38:01 AM MDT Saurabh Das via Digitalmars-d- learn wrote: > The cent and ucent types are reserved for the future. Is there > any knowledge/timeline on when they might be implemented? > > Currently, is there a useable 128bit integer type in DMD/LDC/GDC? > > Or perhaps a library that implements 128bit integers? I've come > across gfm:integers > (https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/w > ideint.d). Are there any other libraries? The language has cent and ucent reserved for the use of 128-bit signed and unsigned integers, but they aren't actually implemented yet, and I don't know what it would take for Walter to decide that it makes sense to implement them (maybe 128-bit x86 CPUs?). So, the language was designed with the idea that they could be added, but there are not currently any plans to add them AFAIK. Phobos has std.bigint, which supports arbitrarily large integers, but there is no standard 128-bit integer solution at present. There may be such a solution on code.dlang.org, but I'm not aware of one. - Jonathan M Davis
Is there any implementation of a 128bit integer?
The cent and ucent types are reserved for the future. Is there any knowledge/timeline on when they might be implemented? Currently, is there a useable 128bit integer type in DMD/LDC/GDC? Or perhaps a library that implements 128bit integers? I've come across gfm:integers (https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.d). Are there any other libraries? Thanks, Saurabh