Re: Separate Printing Mantissa and Exponent of a Floating Point

2014-08-13 Thread Nordlöw
On Monday, 11 August 2014 at 15:30:30 UTC, Justin Whear wrote: 1. http://dlang.org/phobos/std_bitmanip.html#.FloatRep Could someone briefly outline the algorithm that converts the fraction part of FloatRep into a string in base 10? My first guess is sum = 0; foreach (bit_index i,

Re: Separate Printing Mantissa and Exponent of a Floating Point

2014-08-13 Thread Nordlöw
On Wednesday, 13 August 2014 at 07:51:30 UTC, Nordlöw wrote: 1. http://dlang.org/phobos/std_bitmanip.html#.FloatRep Can somebody shortly explain why import std.stdio, std.algorithm, std.range, std.stdio, std.bitmanip; void main(string args[]) { { float x = 1.23e10; auto

safe pure unittest

2014-08-13 Thread simendsjo via Digitalmars-d-learn
This is the first time I've seen attributes on unittests: https://github.com/D-Programming-Language/phobos/pull/2349/files#diff-ba05e420ac1da65db044e79304d641b6R179 Has this always been supported? I guess it's good practice to add these on unittests too, but does people even know about this

drop* and take* only for specific element values

2014-08-13 Thread Nordlöw
Are there variants of drop* and take* that only drop element if its equal to a value kind of like strip does? If not I believe they should be added.

Re: safe pure unittest

2014-08-13 Thread simendsjo via Digitalmars-d-learn
On 08/13/2014 02:50 PM, Dicebot wrote: On Wednesday, 13 August 2014 at 12:26:02 UTC, simendsjo wrote: This is the first time I've seen attributes on unittests: https://github.com/D-Programming-Language/phobos/pull/2349/files#diff-ba05e420ac1da65db044e79304d641b6R179 Has this always been

Re: drop* and take* only for specific element values

2014-08-13 Thread Meta via Digitalmars-d-learn
On Wednesday, 13 August 2014 at 12:37:34 UTC, Nordlöw wrote: Are there variants of drop* and take* that only drop element if its equal to a value kind of like strip does? If not I believe they should be added. No, but it'd probably be useful. Maybe call them dropIf/takeIf, or just add an

Re: drop* and take* only for specific element values

2014-08-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Wed, 13 Aug 2014 14:28:29 + Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 13 August 2014 at 12:37:34 UTC, Nordlöw wrote: Are there variants of drop* and take* that only drop element if its equal to a value kind of like strip does? If not I

Re: safe pure unittest

2014-08-13 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Aug 13, 2014 at 03:03:14PM +0200, simendsjo via Digitalmars-d-learn wrote: On 08/13/2014 02:50 PM, Dicebot wrote: On Wednesday, 13 August 2014 at 12:26:02 UTC, simendsjo wrote: This is the first time I've seen attributes on unittests:

Re: drop* and take* only for specific element values

2014-08-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Wed, 13 Aug 2014 07:45:17 -0700 Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wed, 13 Aug 2014 14:28:29 + Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 13 August 2014 at 12:37:34 UTC, Nordlöw wrote: Are

Re: Emacs d-mode cannot handle backquoted backslashe

2014-08-13 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2014-08-12 at 23:53 +0100, Russel Winder wrote: […] Per Nordlöw has offered a putative fix via a pull request. I'll check out the claim and if it seems to be true (and I fully expect it to be so) I'll accept the pull request. People using MELPA should see the new package quite quickly.

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread Gary Willoughby via Digitalmars-d-learn
On Monday, 11 August 2014 at 20:02:38 UTC, H. S. Teoh via Digitalmars-d-learn wrote: Anyway, clearly we're not understanding each other, so let me present some concrete code so that we aren't just talking past each other: I've used your advice and implemented a range over the list as

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via Digitalmars-d-learn wrote: On Monday, 11 August 2014 at 20:02:38 UTC, H. S. Teoh via Digitalmars-d-learn wrote: Anyway, clearly we're not understanding each other, so let me present some concrete code so that we aren't just talking

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread via Digitalmars-d-learn
On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via Digitalmars-d-learn wrote: On Monday, 11 August 2014 at 20:02:38 UTC, H. S. Teoh via Digitalmars-d-learn wrote: Anyway, clearly we're not

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Aug 13, 2014 at 07:23:30PM +, via Digitalmars-d-learn wrote: On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via Digitalmars-d-learn wrote: [...] I've used your advice and implemented

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via Digitalmars-d-learn wrote: On Monday, 11 August 2014 at 20:02:38 UTC, H. S. Teoh via Digitalmars-d-learn wrote: Anyway, clearly we're not

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Aug 13, 2014 at 07:37:09PM +, Gary Willoughby via Digitalmars-d-learn wrote: On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at 06:31:32PM +, Gary Willoughby via Digitalmars-d-learn wrote: [...] I've used your

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 13 August 2014 at 19:43:20 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at 07:37:09PM +, Gary Willoughby via Digitalmars-d-learn wrote: On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Aug 13, 2014 at 07:58:49PM +, Gary Willoughby via Digitalmars-d-learn wrote: On Wednesday, 13 August 2014 at 19:43:20 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at 07:37:09PM +, Gary Willoughby via Digitalmars-d-learn wrote: On Wednesday, 13 August

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread via Digitalmars-d-learn
On Wednesday, 13 August 2014 at 20:27:29 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at 07:58:49PM +, Gary Willoughby via Digitalmars-d-learn wrote: On Wednesday, 13 August 2014 at 19:43:20 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at

Re: Linked list as a bidirectional range? I have some questions...

2014-08-13 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Aug 13, 2014 at 08:52:32PM +, via Digitalmars-d-learn wrote: On Wednesday, 13 August 2014 at 20:27:29 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, Aug 13, 2014 at 07:58:49PM +, Gary Willoughby via Digitalmars-d-learn wrote: On Wednesday, 13 August 2014 at 19:43:20