On 22/08/2015 15:26, hw wrote:
Hi,
I have the following in a perl script:
if ($a != $b) {
print e: '$a', t: '$b'\n;
}
That will print:
e: '69.99', t: '69.99'
When I replace != with ne (if ($a ne $a) {), it doesn't print.
Is that a bug or a
Am 22.08.2015 um 15:43 schrieb Alan McKinnon:
On 22/08/2015 15:26, hw wrote:
Hi,
I have the following in a perl script:
if ($a != $b) {
print e: '$a', t: '$b'\n;
}
That will print:
e: '69.99', t: '69.99'
When I replace != with ne (if ($a ne $a) {), it doesn't
https://en.wikipedia.org/wiki/Round-off_error
https://en.wikipedia.org/wiki/Machine_epsilon
Either add a tolerance (a - b = t) or compare them as strings as
you've been doing.
On Saturday, August 22, 2015 3:26:56 PM hw wrote:
Hi,
I have the following in a perl script:
if ($a != $b) {
print e: '$a', t: '$b'\n;
}
That will print:
e: '69.99', t: '69.99'
When I replace != with ne (if ($a ne $a) {), it doesn't print.
Is
On Sat, Aug 22, 2015 at 1:32 PM, Alan McKinnon alan.mckin...@gmail.com wrote:
I can tell you that equality comparisons on floats are problematic, and
always will be due to how they are stored (double-precision floats,
inhernetly inexact). This is not a problem per se, it's a systemic
side
On Sat, Aug 22 2015, Mike Gilbert wrote:
On Sat, Aug 22, 2015 at 1:32 PM, Alan McKinnon alan.mckin...@gmail.com
wrote:
I can tell you that equality comparisons on floats are problematic, and
always will be due to how they are stored (double-precision floats,
inhernetly inexact). This is not
On Sat, 22 Aug 2015 16:57:41 hw wrote:
Am 22.08.2015 um 15:43 schrieb Alan McKinnon:
On 22/08/2015 15:26, hw wrote:
Hi,
I have the following in a perl script:
if ($a != $b) {
print e: '$a', t: '$b'\n;
}
That will print:
e:
On 08/22/2015 09:42 AM, R0b0t1 wrote:
https://en.wikipedia.org/wiki/Round-off_error
https://en.wikipedia.org/wiki/Machine_epsilon
Either add a tolerance (a - b = t) or compare them as strings as
you've been doing.
You probably want |a - b| = t there =)
But... that can cause problems too.
On Sat, Aug 22 2015, Michael Orlitzky wrote:
On 08/22/2015 09:42 AM, R0b0t1 wrote:
https://en.wikipedia.org/wiki/Round-off_error
https://en.wikipedia.org/wiki/Machine_epsilon
Either add a tolerance (a - b = t) or compare them as strings as
you've been doing.
You probably want |a - b| =
On 22/08/2015 16:57, hw wrote:
Am 22.08.2015 um 15:43 schrieb Alan McKinnon:
On 22/08/2015 15:26, hw wrote:
Hi,
I have the following in a perl script:
if ($a != $b) {
print e: '$a', t: '$b'\n;
}
That will print:
e: '69.99', t: '69.99'
When I replace !=
On 22/08/2015 17:38, Alexander Kapshuk wrote:
On Sat, Aug 22, 2015 at 4:26 PM, hw h...@gartencenter-vaehning.de wrote:
Hi,
I have the following in a perl script:
if ($a != $b) {
print e: '$a', t: '$b'\n;
}
That will print:
e: '69.99', t: '69.99'
When I replace
On 08/22/2015 01:27 PM, allan gottlieb wrote:
Floating point addition isn't even commutative:
0.1 + 0.2 + 0.3
0.6001
0.1 + (0.2 + 0.3)
0.6
That demonstrates non-associativity. I believe floating point is
commutative: a+b = b+a
Derp, thanks, you're right =)
On Sat, Aug 22, 2015 at 4:26 PM, hw h...@gartencenter-vaehning.de wrote:
Hi,
I have the following in a perl script:
if ($a != $b) {
print e: '$a', t: '$b'\n;
}
That will print:
e: '69.99', t: '69.99'
When I replace != with ne (if ($a ne $a) {), it doesn't
On Sat, 22 Aug 2015 16:57:41 +0200, hw h...@gartencenter-vaehning.de wrote:
Am 22.08.2015 um 15:43 schrieb Alan McKinnon:
On 22/08/2015 15:26, hw wrote:
Hi,
I have the following in a perl script:
if ($a != $b) {
print e: '$a', t: '$b'\n;
}
That
14 matches
Mail list logo