Re: Modulo that 'wraps' the number?

2019-01-20 Thread Paul Backus via Digitalmars-d-learn
On Monday, 21 January 2019 at 04:52:53 UTC, NaN wrote: On Sunday, 20 January 2019 at 18:51:54 UTC, Steven Schveighoffer wrote: On 1/20/19 1:28 PM, faissaloo wrote: In Python -1%3 == 2 however in D -1%3 == -1 Is there a standard library function or something that gives me the Python version of

Re: Modulo that 'wraps' the number?

2019-01-20 Thread NaN via Digitalmars-d-learn
On Sunday, 20 January 2019 at 18:51:54 UTC, Steven Schveighoffer wrote: On 1/20/19 1:28 PM, faissaloo wrote: In Python -1%3 == 2 however in D -1%3 == -1 Is there a standard library function or something that gives me the Python version of modulo? Hm... (n%3+3)%3 should work. -Steve You

Re: API Documentation

2019-01-20 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 20 January 2019 at 16:51:23 UTC, kdevel wrote: Online but not on a local installation I frequently land on pages under https://dlang.org/library/ (API Documentation). What is the reason for this duplicate docs? The API documentation looks much cleaner and better structured.

Re: Modulo that 'wraps' the number?

2019-01-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/20/19 1:28 PM, faissaloo wrote: In Python -1%3 == 2 however in D -1%3 == -1 Is there a standard library function or something that gives me the Python version of modulo? Hm... (n%3+3)%3 should work. -Steve

Modulo that 'wraps' the number?

2019-01-20 Thread faissaloo via Digitalmars-d-learn
In Python -1%3 == 2 however in D -1%3 == -1 Is there a standard library function or something that gives me the Python version of modulo?

API Documentation

2019-01-20 Thread kdevel via Digitalmars-d-learn
Online but not on a local installation I frequently land on pages under https://dlang.org/library/ (API Documentation). What is the reason for this duplicate docs? The API documentation looks much cleaner and better structured. https://dlang.org/library/std/range.html vs.

Re: preconditions and interfaces

2019-01-20 Thread Alex via Digitalmars-d-learn
On Sunday, 20 January 2019 at 15:39:49 UTC, Antonio Corbi wrote: Hi all, Playing with interfaces and preconditions in methods I get strange results with dmd-2.0.84.0 but also with dmd-nightly. My code is like this: - import std.stdio; interface Thing2D { void width(int w)

preconditions and interfaces

2019-01-20 Thread Antonio Corbi via Digitalmars-d-learn
Hi all, Playing with interfaces and preconditions in methods I get strange results with dmd-2.0.84.0 but also with dmd-nightly. My code is like this: - import std.stdio; interface Thing2D { void width(int w) in { writeln("Thing2D.width contract w = ",w);

Re: Compiling to 68K processor (Maybe GDC?)

2019-01-20 Thread Patrick Schluter via Digitalmars-d-learn
On Sunday, 20 January 2019 at 09:27:33 UTC, Jonathan M Davis wrote: On Saturday, January 19, 2019 10:45:41 AM MST Patrick Schluter via Digitalmars-d-learn wrote: On Saturday, 19 January 2019 at 12:54:28 UTC, rikki cattermole wrote: > [...] At least 68030 (or 68020+68851) would be necessary

Re: Compiling to 68K processor (Maybe GDC?)

2019-01-20 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, January 19, 2019 10:45:41 AM MST Patrick Schluter via Digitalmars-d-learn wrote: > On Saturday, 19 January 2019 at 12:54:28 UTC, rikki cattermole > > wrote: > > On 20/01/2019 1:38 AM, Edgar Vivar wrote: > >> Hi, > >> > >> I have a project aiming to old 68K processor. While I don't >