Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add named parameters to math lib #722

Merged
merged 1 commit into from Oct 21, 2022

Conversation

JohnnyMorganz
Copy link
Contributor

Name the parameters used in math lib

This is mainly done to highlight the particular confusion for math.atan2, where y comes before x, but this might not be immediately obvious
image

And then I added the rest of the names for consistency.

Note: I didn't add names to math.random as its currently typed as (number?, number?) -> number. Naming it min and max is technically incorrect for the 1 argument version.
Maybe it should be typed as an intersection instead?

@vegorov-rbx vegorov-rbx merged commit 12ee140 into luau-lang:master Oct 21, 2022
vegorov-rbx added a commit that referenced this pull request Oct 28, 2022
* #719
* Improved `Failed to unify type packs` error message to be reported as
`Type pack 'X' could not be converted into 'Y'`
* #722
* 1% reduction in executed instruction count by removing a check in fast
call dispatch
* Additional fixes to reported error location of OOM errors in VM
* Improve `math.sqrt`, `math.floor` and `math.ceil` performance on
additional compilers and platforms (1-2% geomean improvement including
8-9% on math-cordic)
* All thrown exceptions by Luau analysis are derived from
`Luau::InternalCompilerError`
* When a call site has fewer arguments than required, error now reports
the location of the function name instead of the argument to the
function
* #724
* Fixed #725

Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
Co-authored-by: Andy Friesen <afriesen@roblox.com>
RomanKhafizianov pushed a commit to RomanKhafizianov/luau that referenced this pull request Nov 27, 2023
* luau-lang/luau#719
* Improved `Failed to unify type packs` error message to be reported as
`Type pack 'X' could not be converted into 'Y'`
* luau-lang/luau#722
* 1% reduction in executed instruction count by removing a check in fast
call dispatch
* Additional fixes to reported error location of OOM errors in VM
* Improve `math.sqrt`, `math.floor` and `math.ceil` performance on
additional compilers and platforms (1-2% geomean improvement including
8-9% on math-cordic)
* All thrown exceptions by Luau analysis are derived from
`Luau::InternalCompilerError`
* When a call site has fewer arguments than required, error now reports
the location of the function name instead of the argument to the
function
* luau-lang/luau#724
* Fixed luau-lang/luau#725

Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
Co-authored-by: Andy Friesen <afriesen@roblox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants