9:46 PM
To: Pankaj Bansal ; Volodin, Vladislav
Cc: swing-dev@openjdk.java.net; Jason Mehrens
; Alexey Ivanov
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel
floating point rounding issue
Probably I missed the point but isn't it too many changes for this?
Number base, expectedNe
xed separately.
Regards,
Pankaj
-Original Message-
From: Sergey Bylokhov
Sent: Tuesday, April 7, 2020 9:46 PM
To: Pankaj Bansal ; Volodin, Vladislav
Cc: swing-dev@openjdk.java.net; Jason Mehrens ; Alexey
Ivanov
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
point rounding i
<< Probably I missed the point but isn't it too many changes for this?
<; Volodin, Vladislav
Cc: swing-dev@openjdk.java.net; Jason Mehrens ;
Alexey Ivanov
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
point rounding issue
Probably I missed the point but isn
sal/8220811/webrev02/
Regards,
Pankaj
-Original Message-
From: Volodin, Vladislav
Sent: Sunday, March 15, 2020 2:03 AM
To: Pankaj Bansal
Cc: swing-dev@openjdk.java.net; Jason Mehrens ; Sergey Bylokhov
; Alexey Ivanov
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
ansal/8220811/webrev02/
Regards,
Pankaj
-Original Message-
From: Volodin, Vladislav
Sent: Sunday, March 15, 2020 2:03 AM
To: Pankaj Bansal
Cc: swing-dev@openjdk.java.net; Jason Mehrens ;
Sergey Bylokhov ; Alexey Ivanov
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
po
egards,
Pankaj
-Original Message-
From: Jason Mehrens
Sent: Saturday, March 14, 2020 8:09 PM
To: Pankaj Bansal ; Sergey Bylokhov
; Alexey Ivanov ;
Volodin, Vladislav
Cc: swing-dev@openjdk.java.net
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberMod
Bansal
Sent: Saturday, March 14, 2020 8:11 AM
To: Sergey Bylokhov; Alexey Ivanov; Volodin, Vladislav
Cc: swing-dev@openjdk.java.net
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
point rounding issue
Hello Sergey,
<< It will differ for two cases:
- The error will not be
, March 14, 2020 8:11 AM
To: Sergey Bylokhov; Alexey Ivanov; Volodin, Vladislav
Cc: swing-dev@openjdk.java.net
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
point rounding issue
Hello Sergey,
<< It will differ for two cases:
- The error will not be accumulated when the c
lokhov
Sent: Wednesday, March 11, 2020 5:33 AM
To: Pankaj Bansal ; Alexey Ivanov
; Volodin, Vladislav
Cc: swing-dev@openjdk.java.net
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
point rounding issue
On 3/10/20 5:34 am, Pankaj Bansal wrote:
> Hello Sergey/Vlad/Alexey,
>
On 3/10/20 5:34 am, Pankaj Bansal wrote:
Hello Sergey/Vlad/Alexey,
Sorry, I could not reply to this earlier. I have one doubt about this approach.
Won't the calculation of stepCount itself suffer from floating point issue? I
mean the user will pass min, max, stepsize, then wont the calculation
Hello Sergey/Vlad/Alexey,
Sorry, I could not reply to this earlier. I have one doubt about this
approach. Won't the calculation of stepCount itself suffer from floating
point issue? I mean the user will pass min, max, stepsize, then wont the
calculation of steps required to go from min to max
I think it should work, the step will counts from the default value.
So currently:
1. if the user set default value to X1 and then he iterates forward 100 times then he
will get some X2. During this calculation, he could get "100" rounding issues.
2. If later the user decides iterates backward t
On 17/02/2020 10:35, Sergey Bylokhov wrote:
On 2/17/20 2:25 am, Alexey Ivanov wrote:
As far as I understand your approach, is to select the minimum if
the resulted float value after the calculation is a little bit
smaller than the minimum.
So if the minimum is -0.15 and resulted value is (-0.
On 2/17/20 2:25 am, Alexey Ivanov wrote:
As far as I understand your approach, is to select the minimum if the resulted
float value after the calculation is a little bit smaller than the minimum.
So if the minimum is -0.15 and resulted value is (-0.10d - 0.05d) =
(-0.15002), what v
On 17/02/2020 10:10, Sergey Bylokhov wrote:
On 2/17/20 1:50 am, Alexey Ivanov wrote:
Otherwise there will always be cases where Spinner with float/double
behaves unexpectedly, i.e. does not allow increasing/decreasing a
value where one expects it to.
But what value is expected/unexpected? If
On 2/17/20 1:50 am, Alexey Ivanov wrote:
Otherwise there will always be cases where Spinner with float/double behaves
unexpectedly, i.e. does not allow increasing/decreasing a value where one
expects it to.
But what value is expected/unexpected? If the programmer wants to use float
arithmeti
Hi Vlad,
The idea looks reasonable. However, it does not allow for manual
editing. The cases where max and min values are not multiples of step
would be hard to handle with this approach. For example: max = 10.05,
min = 0.01, step = 0.1; how many ticks are there? What if the user
enters 1.010
On 13/02/2020 21:33, Sergey Bylokhov wrote:
On 2/12/20 8:21 am, Alexey Ivanov wrote:
The bug report says that going from -0.15 to -0.10 does not allow
going back to -0.15. This happens because the result of this sequence
of operations cannot be represented exactly, or, in other words,
because
Hello Sergey, Alexey and Pankaj,
I am reading the current discussion and I was thinking about an idea changing
the code in the way that instead of working with float/double numbers we work
with integer ticks. For example, the model remembers the min/max/step values
and calculates a number of st
On 2/12/20 8:21 am, Alexey Ivanov wrote:
The bug report says that going from -0.15 to -0.10 does not allow going back to
-0.15. This happens because the result of this sequence of operations cannot be
represented exactly, or, in other words, because of rounding errors; or rather
the result is
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel
floating point rounding issue
I am not able to find any issue with this approach.
Sometimes there are difference:
double b = 0.10011;
constructor [1]:
0.1001165734175856414367444813251495361328125
con
essage-
From: Sergey Bylokhov
Sent: Wednesday, February 12, 2020 1:09 PM
To: Pankaj Bansal ; swing-dev@openjdk.java.net
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
point rounding issue
I am not able to find any issue with this approach.
Sometimes there are difference:
do
a+b*c.
Regards,
Pankaj
-Original Message-
From: Sergey Bylokhov
Sent: Wednesday, February 12, 2020 1:09 PM
To: Pankaj Bansal ; swing-dev@openjdk.java.net
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
point rounding issue
> I am not able to find any issue with this
I am not able to find any issue with this approach.
Sometimes there are difference:
double b = 0.10011;
constructor [1]: 0.1001165734175856414367444813251495361328125
constructor [2]: 0.10012
< minimum,
Comparable maximum,
February 12, 2020 2:17 AM
To: Pankaj Bansal ; swing-dev@openjdk.java.net
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
point rounding issue
On 2/11/20 3:40 am, Pankaj Bansal wrote:
> << Could you please try to use Math.fma instead of direct using of
> xxx.toString
On 2/11/20 3:40 am, Pankaj Bansal wrote:
<< Could you please try to use Math.fma instead of direct using of
xxx.toString+BigDecimal
I tried using this, but Math.fma will not solve our issue of precision here.
Math.fma internally creates BigDecimal, but it uses the [1] type constructor to
creat
nt value, int minimum, int maximum, int stepSize)
Regards,
Pankaj
-Original Message-
From: Sergey Bylokhov
Sent: Tuesday, February 11, 2020 7:47 AM
To: Pankaj Bansal ; swing-dev@openjdk.java.net
Subject: Re: [15] RFR JDK-8220811: SpinnerNumberModel floating
point rounding issue
Hi, Pan
Hi, Pankaj.
Could you please try to use Math.fma instead of direct using of
xxx.toString+BigDecimal
if (value instanceof Double) {
newValue = Math.fma(stepSize.doubleValue(), dir, value.doubleValue());
} else {
newValue = Math.fma(stepSize.floatValue(), dir, value.floatValue());
}
Ar
Hi All,
Please review the following fix for jdk15.
Bug:
https://bugs.openjdk.java.net/browse/JDK-8220811
webrev:
http://cr.openjdk.java.net/~pbansal/8220811/webrev00/
Issue:
In case of JSpinner with double/float values, sometime the spinner value does
not change even though the val
29 matches
Mail list logo