Re: Comparing Floating Point numbers

2023-09-25 Thread Mike Beckerle
ve to > convert to IEEE float in this case, you may want to be able to check that > is converts into the float as you expect and then the binary representation > may make sense. > > // Mike > > -----Original Message- > From: Steve Lawrence > Sent: Monday, September 25,

Re: Comparing Floating Point numbers

2023-09-25 Thread Steve Lawrence
ransmission in error, please notify the sender immediately. -Original Message- From: Steve Lawrence Sent: Monday, September 25, 2023 10:01 AM To: dev@daffodil.apache.org Subject: Re: Comparing Floating Point numbers Based on what I've learned today from reading that bug, I thin

RE: Comparing Floating Point numbers

2023-09-25 Thread McGann, Mike
oat in this case, you may want to be able to check that is converts into the float as you expect and then the binary representation may make sense. // Mike -Original Message- From: Steve Lawrence Sent: Monday, September 25, 2023 10:01 To: dev@daffodil.apache.org Subject: Re: Compari

Re: Comparing Floating Point numbers

2023-09-25 Thread Dave Fisher
cation is strictly > prohibited. If you have received this transmission in error, please notify > the sender immediately. > > -Original Message- > From: Steve Lawrence > Sent: Monday, September 25, 2023 10:01 AM > To: dev@daffodil.apache.org > Subject: Re: Compa

RE: Comparing Floating Point numbers

2023-09-25 Thread Sood, Harinder
. -Original Message- From: Steve Lawrence Sent: Monday, September 25, 2023 10:01 AM To: dev@daffodil.apache.org Subject: Re: Comparing Floating Point numbers Based on what I've learned today from reading that bug, I think in Java at least, float -> string -> float will give you back the

Re: Comparing Floating Point numbers

2023-09-25 Thread Steve Lawrence
age- From: Steve Lawrence Sent: Monday, September 25, 2023 08:07 To: dev@daffodil.apache.org Subject: Re: Comparing Floating Point numbers +1 for type aware comparisons. It should be a very small change to this function: https://github.com/apache/daffodil/blob/main/daffodil-lib/src/main/scala/org/apa

Re: Comparing Floating Point numbers

2023-09-25 Thread Mike Beckerle
loating point > math is a deep rabbit hole that can be followed. That is probably overkill > for TDML. > > // Mike > > -Original Message- > From: Steve Lawrence > Sent: Monday, September 25, 2023 08:07 > To: dev@daffodil.apache.org > Subject: Re: Comparing Fl

RE: Comparing Floating Point numbers

2023-09-25 Thread McGann, Mike
l for TDML. // Mike -Original Message- From: Steve Lawrence Sent: Monday, September 25, 2023 08:07 To: dev@daffodil.apache.org Subject: Re: Comparing Floating Point numbers +1 for type aware comparisons. It should be a very small change to this function: https://github.com/apache/daffodil

Re: Comparing Floating Point numbers

2023-09-25 Thread Steve Lawrence
+1 for type aware comparisons. It should be a very small change to this function: https://github.com/apache/daffodil/blob/main/daffodil-lib/src/main/scala/org/apache/daffodil/lib/xml/XMLUtils.scala#L1098 And just need to add xsi:type to a few expected infosets that are sensitive to the issue.

RE: Comparing Floating Point numbers

2023-09-25 Thread McGann, Mike
A third alternative could be to round the result and compare against the rounded value. Epsilon is probably the better idea. I think different infosets per JVM would be too brittle and difficult to keep up-to-date. // Mike -Original Message- From: Mike Beckerle Sent: Sunday, Septembe