How to convert a negative value to positive

From: Angus Comber (ac_at_NOiteloffice.com.PLEASENOSPAM)
Date: 11/28/04


Date: Sat, 27 Nov 2004 23:27:45 -0000

Hello

Sorry this really is a newbie question!

I am doing some floating point arithmetic and calculating the time
difference between two dates. The date values being comparied are actually
double values. I was going to compare the dates by calculating the
difference betwen the two numbers. But sometimes you get a -ve and
sometimes a +ve value. I want to disregard a small variance eg of up to two
minutes but what is best way to compare values.

ie calculate difference and then convert any -ve values to +ve then check if
(diff > x)

or some other way?

AC



Relevant Pages

  • Re: How to convert a negative value to positive
    ... >Sorry this really is a newbie question! ... >I am doing some floating point arithmetic and calculating the time ... I was going to compare the dates by calculating the ...
    (comp.lang.c)
  • Re: How to convert a negative value to positive
    ... Angus Comber wrote: ... I was going to compare the dates by calculating the ... I believe it is still unknown if quantum mechanics quantizes ...
    (comp.lang.c)
  • Compare formula result with text
    ... How do I compare the results of a formula with the text in another field? ... I have a formula that is calculating a date (mm/dd/yyyy) in cell A1. ...
    (microsoft.public.excel.misc)
  • Re: Comparing floating point values in Java
    ... when comparing floating point values in computers. ... In Java, will unchanged values compare strictly true if equal? ... In strictfp mode, the exact, bit-by-bit, result is predictable from the ...
    (comp.lang.java.programmer)
  • Re: Comparing floating point values in Java
    ... when comparing floating point values in computers. ... In Java, will unchanged values compare strictly true if equal? ... In strictfp mode, the exact, bit-by-bit, result is predictable from the ...
    (comp.lang.java.programmer)