Skip to content

Added missing float math operator commands. - #509

Open
MiranDMC wants to merge 3 commits into
masterfrom
new_math_float_commands
Open

MiranDMC wants to merge 3 commits into
masterfrom
new_math_float_commands

Conversation

@MiranDMC

Copy link
Copy Markdown
Collaborator

Requires some changes in Sanny Builder as operations on floats are still compiled using equivalent integer opcodes.

Comment thread CHANGELOG.md Resolved
@MiranDMC
MiranDMC force-pushed the new_math_float_commands branch from 4d5d989 to f5b0ef4 Compare September 13, 2026 10:42
@MiranDMC
MiranDMC marked this pull request as ready for review September 13, 2026 10:45
Comment thread cleo_plugins/Math/Math.cpp Resolved
auto a = OPCODE_READ_PARAM_FLOAT();
auto b = OPCODE_READ_PARAM_FLOAT();

auto result = a / b;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike 0A91, division by zero isn't checked here. Is producing Inf/NaN intentional, or should this SUSPEND("Division by zero") when b == 0.0f?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should stay. It has well defined results for corner cases, while integer division by zero is undefined behavior.
In similar matter we also do not verify args of pow command.

Comment thread tests/cleo_tests/Math/270A.txt Resolved
MiranDMC and others added 2 commits October 7, 2026 02:36
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

Successfully merging this pull request may close these issues.

3 participants