On 3/11/25 9:56 AM, WhatMeWorry wrote:

> In D language, an open interval for the upper limit is indicated by
> using a parenthesis ")" at the end of the range expression, meaning the
> upper bound value itself is not included in the interval.

The only place in D that I know of where that's the case is the std.random module. The following template argument has the quoted effect:

import std.stdio;
import std.random;

void main() {
    foreach (_; 0 .. 10) {
        writeln(uniform!"[)"(0, 3));
    }
}

The value 3 should never be printed there. (But "[)" happens to be the default for it anyway.)

Ali

Reply via email to