Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use of macros for math functions causes unexpected results when argument has side effect #85

Open
Labels
@iacopobaroncini

Description

@iacopobaroncini

Hi folks,

I know it has been discussed already here and there...

I find semantically wrong the fact that the following math functions are implemented as macros:
abs,min,max,constrain,round... and let me addbitWrite to the list.

It is well known that using these function the way the rest of the world does, introduces faults, and therefore generates failures.

Writing something likeabs(cos(x) - 123 * sq(sin(x)) would introduceredundant calculations, just a crazy delay in this case...
Writing something likeabs(a += b) orabs(i++) just introduces afault... it does something different (wrong in fact).

Assuming that usingtemplate andinline functions would solve the issue with no extra executable space taken, I would like to know if there is any other good reason why those dangerous
macro definitions are still in force.

Kind regards,
Iacopo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp