Qwt User's Guide: qwt_math.cpp Source File

- Main Page
- Classes
- Files
- Related Pages

# qwt_math.cpp

    00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
    00002  * Qwt Widget Library
    00003  * Copyright (C) 1997   Josef Wilgen
    00004  * Copyright (C) 2002   Uwe Rathmann
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the Qwt License, Version 1.0
    00008  *****************************************************************************/
    00009
    00010 // vim: expandtab
    00011
    00012 #include "qwt_math.h"
    00013
    00019 double qwtGetMin(const double *array, int size)
    00020 {
    00021     if (size <= 0)
    00022        return 0.0;
    00023
    00024     double rv = array[0];
    00025     for (int i = 1; i < size; i++)
    00026        rv = qwtMin(rv, array[i]);
    00027
    00028     return rv;
    00029 }
    00030
    00031
    00037 double qwtGetMax(const double *array, int size)
    00038 {
    00039     if (size <= 0)
    00040        return 0.0;
    00041
    00042     double rv = array[0];
    00043     for (int i = 1; i < size; i++)
    00044        rv = qwtMax(rv, array[i]);
    00045
    00046     return rv;
    00047 }