~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/approx-equal.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __APROX_EQUAL_H__
 
2
#define __APROX_EQUAL_H__
 
3
 
 
4
#include <cmath>
 
5
 
 
6
inline bool approx_equal(double const a, double const b)
 
7
{
 
8
    return ( (a == b)
 
9
             || ( fabs( a - b ) < 1e-2 )
 
10
             || ( fabs( a / b - 1.0 ) < 1e-2 ) );
 
11
}
 
12
 
 
13
 
 
14
#endif /* !__APROX_EQUAL_H__ */
 
15
 
 
16
/*
 
17
  Local Variables:
 
18
  mode:c++
 
19
  c-file-style:"stroustrup"
 
20
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
21
  indent-tabs-mode:nil
 
22
  fill-column:99
 
23
  End:
 
24
*/
 
25
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :