aboutsummaryrefslogtreecommitdiff
path: root/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Types/CInt.htm
blob: 1af7f157217ee0353abbf9b07dffd1992dd707e5 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<html>

<head>
    
  <script type="text/javascript" src="../../../../Scripts/jquery.js">
  </script>
    
  <script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
  </script>
    
  <script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
  </script>
    
  <script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
  </script>
    
  <script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
  </script>
    
  <link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
    
  <link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
  

  <title>CInt</title>

  <link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">

    
  <script type="text/javascript" src="../../../../Scripts/bootstrap.js">
  </script>
  
</head>

<body bgcolor="#FFFFFF">
    
  <!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
    
  <!-- DO NOT EDIT MANUALLY !!! -->
  
  <table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
    <tr>
      <td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
      </td>
      <td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
      </td>
      <td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
      </td>
    </tr>
  </table>
  <h1>CInt</h1>


  <p class="Decl">Del.&raquo;<br> {$IFDEF use_int32}<br> &nbsp;cInt = Int32;<br> {$ELSE}<br> &nbsp;&nbsp;cInt = Int64;<br> {$ENDIF}<br> </p>

  <p class="Decl2">C++&nbsp;&raquo;<br> #ifdef use_int32<br> &nbsp;&nbsp;typedef int cInt;<br> #else<br> &nbsp;&nbsp;typedef signed long long cInt;<br> #endif </p>

  <p class="Decl3">C#&nbsp;&nbsp;&raquo;<br> #if use_int32<br> &nbsp;&nbsp;using cInt = Int32;<br> #else<br> &nbsp;&nbsp;using cInt = Int64;<br> #endif </p>


  <p class="Body"> <b>cInt</b> is the integer type used by the Clipper Library to represent vertex coordinate values. (See also <a href="./IntPoint.htm">IntPoint</a>.)<br><br> The library uses integers instead of floating point values to preserve <a href="http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf" target="_blank">numerical robustness</a>. (Very early versions of the library used floating point coordinates, but it became apparent that floating point imprecision was always going to cause occasional errors.)<br><br> By default <b>cInt</b> represents a signed 64bit integer and polygon coordinates can have any value in the range &plusmn; 9.2e+18. This accommodates the scaling of floating point coordinate values to very large integers so that very high degrees of precision can be retained during clipping. However, if coordinate values can be kept within the range &plusmn; 3.0e+9, then by avoiding large integer math, a modest ~10% improvement in clipping performance is achieved.<br><br> If the preprocessor directive <a href="../PreProcessor/Defines.htm"><b>use_int32</b></a> is defined, cInt will represent a signed 32bit integer. This improves clipping performance by 20-30% but the trade-off is that coordinate values are restricted to the much narrower range of &plusmn; 46340. </p>

  <h2 id="Auto-SeeAlso">See Also</h2>
  <p class="Body"><a href="../PreProcessor/Defines.htm">Defines</a>, <a href="IntPoint.htm">IntPoint</a></p>
    
  <p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
  
</body>

</html>