<HTML><BODY>Hello.<br>I try to get&nbsp;difference between two ranges. For instance I have to know how many meters from me to target who have own size (or range).<br><br><p style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="color: #ba2da2;" data-mce-style="color: #ba2da2;">let</span> range = <span style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span>...<span style="color: #272ad8;" data-mce-style="color: #272ad8;">5</span></p><p style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="color: #ba2da2;" data-mce-style="color: #ba2da2;">let</span> meFromPoint = <span style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span>...<span style="color: #272ad8;" data-mce-style="color: #272ad8;">10</span></p><p style="margin-bottom: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" data-mce-style="margin-bottom: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;">&nbsp;</p><p style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="color: #ba2da2;" data-mce-style="color: #ba2da2;">let</span> setRange = <span style="color: #703daa;" data-mce-style="color: #703daa;">Set</span>(<span style="color: #4f8187;" data-mce-style="color: #4f8187;">range</span>)</p><p style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="color: #ba2da2;" data-mce-style="color: #ba2da2;">let</span> setMeFromPoint = <span style="color: #703daa;" data-mce-style="color: #703daa;">Set</span>(<span style="color: #4f8187;" data-mce-style="color: #4f8187;">meFromPoint</span>)</p><p style="margin-bottom: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" data-mce-style="margin-bottom: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;">&nbsp;</p><p style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: #4f8187;" data-mce-style="margin-bottom: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: #4f8187;"><span style="color: #ba2da2;" data-mce-style="color: #ba2da2;">let</span><span style="color: #000000;" data-mce-style="color: #000000;"> diff = </span>setMeFromPoint<span style="color: #000000;" data-mce-style="color: #000000;">.</span><span style="color: #3e1e81;" data-mce-style="color: #3e1e81;">subtracting</span><span style="color: #000000;" data-mce-style="color: #000000;">(</span>setRange<span style="color: #000000;" data-mce-style="color: #000000;">).</span><span style="color: #703daa;" data-mce-style="color: #703daa;">count</span><span style="color: #008400;" data-mce-style="color: #008400;">// result 5</span></p><br>I found that operation Set(0...veryBigInt) may be slow.<br>Is exist some native way to get difference between two Ranges?<br><br><br>-- <br>Седых Александр</BODY></HTML>