Skip to content

Conversation

ds26gte
Copy link
Contributor

@ds26gte ds26gte commented Sep 20, 2025

This in-progress PR addresses Issue #1812.

A JS test file tests/jsnums-test/jsnums-test.c will test the methods and functions defined in js-numbers.js (Pyret's number library) that cannot be adequately tested by Pyret test files such as tests/pyret/tests/test-numbers.js.

This PR is WIP, and not ready to merge yet.

expect(JN.fromString("1e140", sampleErrorBacks)).toEqual(JN.makeBignum("1e140"));

// for large bignums (> 1e140 ?), fromString() and makeBignum() can give structurally
// unequal results. so the following fail:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ds26gte why are these commented out? We should be testing to make sure they fail, right?

- ensure integerNthRoot() is monotonically nondecreasing brownplt#1822
- require integerNthRoot() root and radicand to be non-neg
- require nthRoot() root to be non-neg
** should remove fields at .t and above
** should remove any trailing zero fields, also reducing .t
- bnDivide() should call clamp()
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