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

more static methods for Integer + Float #6784

Closed
gavinking opened this Issue Dec 2, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@gavinking
Contributor

gavinking commented Dec 2, 2016

I have added smallest(), largest(), min(), max(), and product() to Integer and Float, along with Java implementations.

@chochos for some reason the Ceylon implementation of these static methods gets ignored by the JS compiler, so I need you to add implementations for JS.

@chochos

This comment has been minimized.

Contributor

chochos commented Dec 6, 2016

Integer.ceylon and Float.ceylon are not compiled because they're a mess due to interop so it's still all native

chochos added a commit that referenced this issue Dec 7, 2016

chochos added a commit that referenced this issue Dec 7, 2016

chochos added a commit that referenced this issue Dec 7, 2016

@chochos chochos closed this Dec 7, 2016

@gavinking

This comment has been minimized.

Contributor

gavinking commented Dec 7, 2016

Thanks!

@gavinking

This comment has been minimized.

Contributor

gavinking commented Dec 7, 2016

Wait, @chochos, it doesn't look like Float.min(), Float.max(), Float.smallest(), Float.largest() are handling NaN or -0.0 correctly.

@gavinking

This comment has been minimized.

Contributor

gavinking commented Dec 7, 2016

I tried to fix this, but I give up. Something very screwy here with -0.0.

gavinking added a commit that referenced this issue Dec 7, 2016

@gavinking

This comment has been minimized.

Contributor

gavinking commented Dec 7, 2016

OK I fixed it. So JavaScript's valueOf() method doesn't correctly handle -0?

@gavinking gavinking closed this Dec 7, 2016

@chochos

This comment has been minimized.

Contributor

chochos commented Dec 7, 2016

Seems it doesn't. That's why I didn't optimize division and left it as a call to quotient or whatever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment