Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo in transform template #134

Open
travisdowns opened this issue Oct 16, 2021 · 0 comments
Open

typo in transform template #134

travisdowns opened this issue Oct 16, 2021 · 0 comments

Comments

@travisdowns
Copy link

travisdowns commented Oct 16, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant