File: est-epsilon.cxx

package info (click to toggle)
flightgear 1:2016.4.4+dfsg-3+deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 48,512 kB
  • ctags: 71,727
  • sloc: cpp: 195,395; ansic: 177,152; sh: 13,661; perl: 4,475; python: 2,381; asm: 642; makefile: 398; java: 314; xml: 85
file content (34 lines) | stat: -rw-r--r-- 464 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#ifdef HAVE_WINDOWS_H
#  include <windows.h>
#endif

#include <stdio.h>

#include <simgear/compiler.h>
#if defined( __APPLE__)
# include <OpenGL/OpenGL.h>
#else
# include <GL/gl.h>
#endif

int main() {
    GLfloat a, t;

    a = 1.0;

    do {
	printf("a = %.10f\n", a);
	a = a / 2.0;
	t = 1.0 + a;
    } while ( t > 1.0 );

    a = a + a;

    printf("Estimated GLfloat epsilon = %.10f\n", a);

    return(0);
}