addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1launch-new-window--smalllight-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

New Math Methods

From: Richard W.
Sent on: Tuesday, February 7, 2012 8:30 PM
Hey all,

I'm interested to know if there was any LJC consensus about which
overflow safe Mathematical functions to introduce in Java 8.  Stephen
Colebourne makes the case for several more methods than are currently
planned to go in on his blog -
http://blog.joda....­.  The case
for not including them is probably best summed up by the following
quote from openjdk's java-core-libs mailing list.

"First of all, negate(x) certainly is replaceable by subtractExact(0,
x). Secondly, the problem is more that people don't realize that -x
might not be exact. If you know there's a problem then it isn't any
easier for you to know that a solution is to be found in Math than to
know that the problem is with MIN_VALUE."

The case against increment and decrement is similar - that they're
easy to if you've got safe addition/subtraction­.

Perhaps you don't care at all about this and consider it a minor
implementation detail - I'm also interested in hearing any opinions on
the subject.

regards,

  Richard

Our Sponsors

  • Our Blog

    Read the latest news from the LJC

  • RecWorks Ltd

    Fixing Tech Recruitment using the Power of Community

  • jClarity

    Java/JVM Performance Analysis Tools & mentoring for Java related matters

  • LJC Aggrity

    Our LJC Aggrity site contains blog posts from our members

  • LJC Book Club

    Our Book club with book reviews from our members

  • Devoxx UK

    Java Community Conference in collaboration with the LJC, 8-10th June 16

  • SkillsMatter

    "Host, help organise, promote, film many of our meetings."

  • IBM

    Build Enterprise-grade apps at start-up speed.

  • New Relic

    New Relic makes sense of billions of metrics a day in real time.

  • Hazelcast

    Hazelcast is the leader in operating in-memory computing.

  • Java.Net

    We are an official Java User Group recognised by Oracle's JUG program

  • JRebel

    Free 3 month J-Rebel license.

  • O'Reilly

    40% discount on printed books and 50% on e-books.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy