8000 typo in transform template · Issue #134 · libmir/mir-random · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
typo in transform template #134
Open
@travisdowns

Description

@travisdowns

I believe there is a typo in the template below:

template transform(string f0, string f1, string f2, string c)
{
    import std.array : replace;
    enum raw = `_f0 *= _c;
                _f0 = copysign(exp(_f0), _c);
                _f2 = _c * _f1 * _f1 + _f2;
                _f2 *= _c * _f0;
                _f1 *= c;
                _f1 *= _f0;`;
    enum transform = raw.replace("_f0", f0).replace("_f1", f1).replace("_f2", f2).replace("_c", c);
}

Note the line _f1 *= c;, I believe it should be _f1 *= _c;.

It happens to work because everywhere it is called the input variable happens to be named 'c' so the replace("_c", c) isn't strictly necessary in those cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0