Skip to content

Fix gcd type#2922

Merged
josdejong merged 5 commits into
josdejong:developfrom
brunoSnoww:fix-gcd-type
Mar 27, 2023
Merged

Fix gcd type#2922
josdejong merged 5 commits into
josdejong:developfrom
brunoSnoww:fix-gcd-type

Conversation

@brunoSnoww
Copy link
Copy Markdown
Contributor

@brunoSnoww brunoSnoww commented Mar 24, 2023

This PR refactors the current type of the gcd function so that the following cases gets warned by Typescript ( which is not currently happening ):

const Xe = [[1,5],[10,49]]
const Ye= [[1,5],[5,7]]

const Re = math.gcd([Xe,Ye]) // it throws, but no warning
const Rc = math.chain([math.complex(3,5),math.complex(6,10)]).gcd().done() // it throws, but no warning

GCD accepts an array as a parameters, but their items should not be arrays as well ( though can be matrices )

@brunoSnoww brunoSnoww marked this pull request as ready for review March 24, 2023 16:22
@josdejong
Copy link
Copy Markdown
Owner

Thanks Bruno, nice improvement 👍

@josdejong josdejong merged commit 079300f into josdejong:develop Mar 27, 2023
@josdejong
Copy link
Copy Markdown
Owner

Published now in v11.8.0

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.

2 participants