forum service is not available?
D
dd at mail.com
Sun Jan 20 21:46:52 UTC 2019
On Saturday, 15 December 2018 at 16:26:23 UTC, Brian wrote:
> forum.dlang.org is currently overloaded, or is temporarily down
> for maintenance, and should be back up shortly. Apologies for
> the inconvenience.
I'm getting this message:
"Your message has been saved, and will be posted after being
approved by a moderator."
On Learn topic, and this is what I was replying:
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
If the divisor is negative you can just add dividend after the
modulus and get the same result like Python. In this way you save
one % operation.
Donna.
More information about the Digitalmars-d
mailing list