Skip to content

Fix float truncation in SPEED and MIN_TICKS constants#552

Open
PLAZMAMA wants to merge 1 commit intoPufferAI:4.0from
PLAZMAMA:minimal-fix-float-truncation
Open

Fix float truncation in SPEED and MIN_TICKS constants#552
PLAZMAMA wants to merge 1 commit intoPufferAI:4.0from
PLAZMAMA:minimal-fix-float-truncation

Conversation

@PLAZMAMA
Copy link
Copy Markdown
Contributor

@PLAZMAMA PLAZMAMA commented May 2, 2026

I read through ocean/minimal/minimal.h for line count reduction, but wasn't able to find anything.
But I did find a float truncation(I don't know if its intended or not).

SPEED = 20.0f and MIN_TICKS = COOLDOWN*AGENTS/(float)TARGETS are declared in a const int list, silently truncating their float values.

I Fixed it by splitting them onto their own const float line.

Both were declared as const int, silently truncating their float values.
Moved to a const float line so the types match the intent.
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.

1 participant