digitalmars.D.learn - Is there a 128-bit integer in D?
- Saurabh Das (7/7) May 21 2016 I see that 'cent' and 'ucent' are reserved for future use but not
- Stefan Koch (2/9) May 21 2016 There is BigInt in phobos.
- tcak (5/16) May 22 2016 I think cent and ucent could be implemented as ulong is possible
- Jonathan M Davis via Digitalmars-d-learn (7/12) May 21 2016 The keywords are reserved for future use not in current use. So, no, the...
- Saurabh Das (3/16) May 21 2016 Thankyou. I'll have a look at that.
- Nicholas Wilson (4/11) May 22 2016 There is a recursive arbitrary sized integer implementation
- Guillaume Piolat (2/15) May 22 2016 https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/...
- Saurabh Das (3/19) May 22 2016 wideint was exactly what I was looking for! Thank you so much :)
- Era Scarecrow (3/6) May 22 2016 I WANT! If this does the job, I want it as part of the Phobos
- Guillaume Piolat (4/12) May 22 2016 This request again ;)
- Era Scarecrow (23/25) May 22 2016 Glancing briefly at the source, it appears (from what I saw)
- Seb (10/24) May 23 2016 1) Open PR for initial review
I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos? Thanks, Saurabh
May 21 2016
On Saturday, 21 May 2016 at 09:43:38 UTC, Saurabh Das wrote:I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos? Thanks, SaurabhThere is BigInt in phobos.
May 21 2016
On Saturday, 21 May 2016 at 09:56:51 UTC, Stefan Koch wrote:On Saturday, 21 May 2016 at 09:43:38 UTC, Saurabh Das wrote:I think cent and ucent could be implemented as ulong is possible to be used on 32-bit systems by adding extra assembly instructions. This way, when (and if) 128-bit systems are developed, compiler would be updated only.I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos? Thanks, SaurabhThere is BigInt in phobos.
May 22 2016
On Saturday, May 21, 2016 09:43:38 Saurabh Das via Digitalmars-d-learn wrote:I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types?The keywords are reserved for future use not in current use. So, no, there are no 128-bit integer types in D currently. It's just that we left the door open for ourselves to add them later without breaking programs due to having to create a new keyword.Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos?We've had that for years. It's BigInt in std.bigint. - Jonathan M Davis
May 21 2016
On Saturday, 21 May 2016 at 21:51:34 UTC, Jonathan M Davis wrote:On Saturday, May 21, 2016 09:43:38 Saurabh Das via Digitalmars-d-learn wrote:Thankyou. I'll have a look at that. SaurabhI see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types?The keywords are reserved for future use not in current use. So, no, there are no 128-bit integer types in D currently. It's just that we left the door open for ourselves to add them later without breaking programs due to having to create a new keyword.Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos?We've had that for years. It's BigInt in std.bigint. - Jonathan M Davis
May 21 2016
On Saturday, 21 May 2016 at 09:43:38 UTC, Saurabh Das wrote:I see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos? Thanks, SaurabhThere is a recursive arbitrary sized integer implementation floating around somewhere. Perhaps try dub for some math libraries.
May 22 2016
On Sunday, 22 May 2016 at 07:40:08 UTC, Nicholas Wilson wrote:On Saturday, 21 May 2016 at 09:43:38 UTC, Saurabh Das wrote:https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.dI see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos? Thanks, SaurabhThere is a recursive arbitrary sized integer implementation floating around somewhere. Perhaps try dub for some math libraries.
May 22 2016
On Sunday, 22 May 2016 at 09:07:32 UTC, Guillaume Piolat wrote:On Sunday, 22 May 2016 at 07:40:08 UTC, Nicholas Wilson wrote:wideint was exactly what I was looking for! Thank you so much :) SaurabhOn Saturday, 21 May 2016 at 09:43:38 UTC, Saurabh Das wrote:https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.dI see that 'cent' and 'ucent' are reserved for future use but not yet implemented. Does anyone have a working implementation of these types? Alternatively, is there an any effort towards implementation of arbitrary-sized integers in Phobos? Thanks, SaurabhThere is a recursive arbitrary sized integer implementation floating around somewhere. Perhaps try dub for some math libraries.
May 22 2016
On Sunday, 22 May 2016 at 09:39:45 UTC, Saurabh Das wrote:On Sunday, 22 May 2016 at 09:07:32 UTC, Guillaume Piolat wrote:I WANT! If this does the job, I want it as part of the Phobos library!!https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.dwideint was exactly what I was looking for! Thank you so much :)
May 22 2016
On Sunday, 22 May 2016 at 09:47:54 UTC, Era Scarecrow wrote:On Sunday, 22 May 2016 at 09:39:45 UTC, Saurabh Das wrote:This request again ;) I don't know how this works, someone has to propose it, clean it up and respond to feedback I guess.On Sunday, 22 May 2016 at 09:07:32 UTC, Guillaume Piolat wrote:I WANT! If this does the job, I want it as part of the Phobos library!!https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.dwideint was exactly what I was looking for! Thank you so much :)
May 22 2016
On Sunday, 22 May 2016 at 12:03:16 UTC, Guillaume Piolat wrote:I don't know how this works, someone has to propose it, clean it up and respond to feedback I guess.Glancing briefly at the source, it appears (from what I saw) it's heavily based on doubling the size of a lower type (2 64's to equal a 128, etc). This means to get the next level up you double again. So if I read it right for example, the opIncrease does this almost verbatim: opIncrease() { //aka ++ low++; if (low == 0) //overflow detection high++; } Going from native up one level is easy enough, but to do a 256 type it would do the same from a lower level. Meaning the int256 type does opIncrease on 2 int128 types, which break down to the native long type. Making a 256 or 512 silently creates all the lower ones until it can lower to a native type as the starting point. More importantly is if they fully act as built-in types with their declarations, except (for maybe auto promotion of course, although that might work too). The only two operations that are going to be slow no matter how you slice it are multiply and divide. If you don't use multiply or divide, your code will be fast regardless how many levels it goes.
May 22 2016
On Sunday, 22 May 2016 at 12:03:16 UTC, Guillaume Piolat wrote:On Sunday, 22 May 2016 at 09:47:54 UTC, Era Scarecrow wrote:1) Open PR for initial review 2) Select review manager (from the inital reviewers) 3) Open NG thread and add the addition to the queue (http://wiki.dlang.org/Review_Queue) 4) Hope for positive feedback In the last month there was a tendency to only accept successful dub packages, so it might make sense to separate this into its own dub package and clean it up. This will also make it easier for other people to find.On Sunday, 22 May 2016 at 09:39:45 UTC, Saurabh Das wrote:This request again ;) I don't know how this works, someone has to propose it, clean it up and respond to feedback I guess.On Sunday, 22 May 2016 at 09:07:32 UTC, Guillaume Piolat wrote:I WANT! If this does the job, I want it as part of the Phobos library!!https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.dwideint was exactly what I was looking for! Thank you so much :)
May 23 2016