Skip to content

alias "int" is misleading #86

@Butterroach

Description

@Butterroach

the issue is at line 224 of scripts/audioProcessor.mjs

		params.push('int', 'window');
		values.push(Math.floor, globalThis);

when a function is called int it usually means the function truncates the value passed, here it's actually flooring the value

the difference between flooring and truncating is that flooring will round towards -infinity, while truncating will round towards 0

for example, -2.4 will be floored to -3, but it will be truncated to -2

you can change the int to be an alias to Math.trunc to fix this

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions