java - Implement sound Interval Arithmetic -


how implement sound interval arithmetic in java?

i need implement sound interval arithmetic java. let's take type double example, use iterval [0.09999....005, 0.1000000...05] describe value range information of value "0.1", because "0.1" cannot strictly represented ieee-754 standard, namely double type in java. when considering operation 0.1 * 0.1, practical result may 0.01000...5, or 0.00999..5 within different rounding modes. interval arithmetic result should [lefthand, righthand], , lefthand should less 0.01000...5, righthand should more 0.00999..5. when use type double implememnt arithmetic, meet 2 questions:

  1. when calculate left-hand of interval, want set rounding mode down, left-hand value less practical value. namely, need calculate number doule type less practical value , number double type more practical value. call interval arithmetical sound.
  2. i need function calculate maximum in 4 double numbers.namely, double max(d1, d2, d3, d4), return maximum double number in d1,d2,d3 , d4.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -