Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

more static methods for Integer + Float #6784

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

more static methods for Integer + Float #6784

gavinking opened this issue Dec 2, 2016 · 6 comments
Assignees
Milestone

Comments

@gavinking
Copy link
Contributor

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
Copy link
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 as completed Dec 7, 2016
@gavinking
Copy link
Contributor Author

Thanks!

@gavinking
Copy link
Contributor Author

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

@gavinking
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@chochos
Copy link
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants