Skip to content

[BUG] v3.4.1 Stable - Internal Variable Rounding Error #3066

Open
@Poncho42

Description

@Poncho42

Is this a bug in companion itself or a module?

  • I believe this to be a bug in companion

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Incrementing a custom internal variable by 0.1 has rounding errors making numbers 18 significant digits long

Steps To Reproduce

  1. Create internal Variable $(internal:custon_round)
  2. Set Start value to 0.5
  3. Make a Button
  4. Add Action "internal: Custom Variable: Set with expression"
  5. Change Custom Variable to "A custom Variable (internal:custon_round)
  6. input "$(internal:custom_round)+0.1
  7. Press Button 2-5 times and see the rounding issue

Expected Behavior

After 3 presses expected output is 0.8, actual output is 0.7999999999999999

Environment (please complete the following information)

- OS: Windows 11 Pro
- Browser: Chrome
- Companion Version: v3.4.1

Additional context

First couple of button presses add properly, but the farther you get from the starting value the more off it gets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions