Re: abs question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill Cunningham

    Re: abs question


    "Martin Ambuhl" <mambuhl@earthl ink.netwrote in message
    news:gc6j34$u06 $1@registered.m otzarella.org.. .
    #include <stdio.h>
    #include <stdlib.h>
    >
    int main(int argc, char *argv[])
    {
    double current_high, current_low, prevous_close, current_range,
    low_vs_close, high_vs_close;
    if (argc != 4) {
    fprintf(stderr, "TR usage error:\n"
    "program_na me current_high current_low "
    "prevous_close\ n");
    exit(EXIT_FAILU RE);
    }
    current_high = strtod(argv[1], NULL);
    current_low = strtod(argv[2], NULL);
    prevous_close = strtod(argv[3], NULL);
    current_range = current_high - current_low;
    low_vs_close = current_low - prevous_close;
    high_vs_close = current_high - prevous_close;
    if (current_range low_vs_close && current_range high_vs_close)
    printf("%.2f\n" , current_range);
    if (low_vs_close current_range && low_vs_close high_vs_close)
    printf("%.2f\n" , low_vs_close);
    if (high_vs_close current_range && high_vs_close low_vs_close)
    printf("%.2f\n" , high_vs_close);
    return 0;
    }
    I think that might just be the answer martin :) thanks I will
    incorporate this into my code.

    Bill


Working...