/usr/share/doc/stilts/sun256/uk.ac.starlink.ttools.func.Arithmetic.html is in stilts-doc 3.1.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="sun-style.css">
<title>Arithmetic</title>
</head>
<body>
<hr>
<a href="uk.ac.starlink.ttools.func.TrigDegrees.html">Next</a> <a href="uk.ac.starlink.ttools.func.Arrays.html">Previous</a> <a href="staticMethods.html">Up</a> <a href="index.html">Contents</a> <br> <b>Next: </b><a href="uk.ac.starlink.ttools.func.TrigDegrees.html">TrigDegrees</a><br>
<b>Up: </b><a href="staticMethods.html">Functions</a><br>
<b>Previous: </b><a href="uk.ac.starlink.ttools.func.Arrays.html">Arrays</a><br>
<hr>
<h4><a name="uk.ac.starlink.ttools.func.Arithmetic">10.5.7 Arithmetic</a></h4>
<p>Standard arithmetic functions including things like rounding,
sign manipulation, and maximum/minimum functions.
Phase folding operations, and a convenient form of the modulus operation
on which they are based, are also provided.
</p>
<p>
<dl>
<dt><strong><code>roundUp( x )</code></strong></dt>
<dd>Rounds a value up to an integer value.
Formally, returns the smallest (closest to negative infinity)
integer value that is not less than the argument.
<ul>
<li><code>x</code> <em>(floating point)</em>: a value.
</li>
<li>return value <em>(integer)</em>: <code>x</code> rounded up
</li>
</ul>
</dd>
<dt><strong><code>roundDown( x )</code></strong></dt>
<dd>Rounds a value down to an integer value.
Formally, returns the largest (closest to positive infinity)
integer value that is not greater than the argument.
<ul>
<li><code>x</code> <em>(floating point)</em>: a value
</li>
<li>return value <em>(integer)</em>: <code>x</code> rounded down
</li>
</ul>
</dd>
<dt><strong><code>round( x )</code></strong></dt>
<dd>Rounds a value to the nearest integer.
Formally,
returns the integer that is closest in value
to the argument. If two integers are
equally close, the result is the even one.
<ul>
<li><code>x</code> <em>(floating point)</em>: a floating point value.
</li>
<li>return value <em>(integer)</em>: <code>x</code> rounded to the nearest integer
</li>
</ul>
</dd>
<dt><strong><code>roundDecimal( x, dp )</code></strong></dt>
<dd>Rounds a value to a given number of decimal places.
The result is a <code>float</code> (32-bit floating point value),
so this is only suitable for relatively low-precision values.
It's intended for truncating the number of apparent significant
figures represented by a value which you know has been obtained
by combining other values of limited precision.
For more control, see the functions in the <code>Formats</code> class.
<ul>
<li><code>x</code> <em>(floating point)</em>: a floating point value
</li>
<li><code>dp</code> <em>(integer)</em>: number of decimal places (digits after the decimal point)
to retain
</li>
<li>return value <em>(floating point)</em>: floating point value close to <code>x</code> but with a
limited apparent precision
</li>
</ul>
</dd>
<dt><strong><code>abs( x )</code></strong></dt>
<dd>Returns the absolute value of an integer value.
If the argument is not negative, the argument is returned.
If the argument is negative, the negation of the argument is returned.
<ul>
<li><code>x</code> <em>(integer)</em>: the argument whose absolute value is to be determined
</li>
<li>return value <em>(integer)</em>: the absolute value of the argument.
</li>
</ul>
</dd>
<dt><strong><code>abs( x )</code></strong></dt>
<dd>Returns the absolute value of a floating point value.
If the argument is not negative, the argument is returned.
If the argument is negative, the negation of the argument is returned.
<ul>
<li><code>x</code> <em>(floating point)</em>: the argument whose absolute value is to be determined
</li>
<li>return value <em>(floating point)</em>: the absolute value of the argument.
</li>
</ul>
</dd>
<dt><strong><code>max( a, b )</code></strong></dt>
<dd>Returns the greater of two integer values.
If the arguments have the same value, the result is that same value.
<p>Multiple-argument maximum functions are also provided in the
<code>Arrays</code> and <code>Lists</code> packages.
<ul>
<li><code>a</code> <em>(integer)</em>: an argument.
</li>
<li><code>b</code> <em>(integer)</em>: another argument.
</li>
<li>return value <em>(integer)</em>: the larger of <code>a</code> and <code>b</code>.
</li>
</ul>
</p>
</dd>
<dt><strong><code>maxNaN( a, b )</code></strong></dt>
<dd>Returns the greater of two floating point values.
If the arguments have the same value, the result is that same
value. If either value is blank, then the result is blank.
<ul>
<li><code>a</code> <em>(floating point)</em>: an argument.
</li>
<li><code>b</code> <em>(floating point)</em>: another argument.
</li>
<li>return value <em>(floating point)</em>: the larger of <code>a</code> and <code>b</code>.
</li>
</ul>
</dd>
<dt><strong><code>maxReal( a, b )</code></strong></dt>
<dd>Returns the greater of two floating point values, ignoring blanks.
If the arguments have the same value, the result is that same value.
If one argument is blank, the result is the other one.
If both arguments are blank, the result is blank.
<p>Multiple-argument maximum functions are also provided in the
<code>Arrays</code> and <code>Lists</code> packages.
<ul>
<li><code>a</code> <em>(floating point)</em>: an argument
</li>
<li><code>b</code> <em>(floating point)</em>: another argument
</li>
<li>return value <em>(floating point)</em>: the larger non-blank value of <code>a</code> and <code>b</code></li>
</ul>
</p>
</dd>
<dt><strong><code>min( a, b )</code></strong></dt>
<dd>Returns the smaller of two integer values.
If the arguments have the same value, the result is that same value.
<p>Multiple-argument minimum functions are also provided in the
<code>Arrays</code> and <code>Lists</code> packages.
<ul>
<li><code>a</code> <em>(integer)</em>: an argument.
</li>
<li><code>b</code> <em>(integer)</em>: another argument.
</li>
<li>return value <em>(integer)</em>: the smaller of <code>a</code> and <code>b</code>.
</li>
</ul>
</p>
</dd>
<dt><strong><code>minNaN( a, b )</code></strong></dt>
<dd>Returns the smaller of two floating point values.
If the arguments have the same value, the result is that same value.
If either value is blank, then the result is blank.
<ul>
<li><code>a</code> <em>(floating point)</em>: an argument.
</li>
<li><code>b</code> <em>(floating point)</em>: another argument.
</li>
<li>return value <em>(floating point)</em>: the smaller of <code>a</code> and <code>b</code>.
</li>
</ul>
</dd>
<dt><strong><code>minReal( a, b )</code></strong></dt>
<dd>Returns the smaller of two floating point values, ignoring blanks.
If the arguments have the same value, the result is that same value.
If one argument is blank, the result is the other one.
If both arguments are blank, the result is blank.
<p>Multiple-argument minimum functions are also provided in the
<code>Arrays</code> and <code>Lists</code> packages.
<ul>
<li><code>a</code> <em>(floating point)</em>: an argument
</li>
<li><code>b</code> <em>(floating point)</em>: another argument
</li>
<li>return value <em>(floating point)</em>: the larger non-blank value of <code>a</code> and <code>b</code></li>
</ul>
</p>
</dd>
<dt><strong><code>mod( a, b )</code></strong></dt>
<dd>Returns the non-negative remainder of <code>a/b</code>.
This is a modulo operation, but differs from the expression
<code>a%b</code> in that the answer is always >=0
(as long as <code>b</code> is not zero).
<ul>
<li><code>a</code> <em>(floating point)</em>: dividend
</li>
<li><code>b</code> <em>(floating point)</em>: divisor
</li>
<li>return value <em>(floating point)</em>: non-negative remainder when
dividing <code>a</code> by <code>b</code></li>
</ul>
</dd>
<dt><strong><code>phase( t, period )</code></strong></dt>
<dd>Returns the phase of a value within a period.
<p>For positive period, the returned value is in the range [0,1).
<ul>
<li><code>t</code> <em>(floating point)</em>: value
</li>
<li><code>period</code> <em>(floating point)</em>: folding period
</li>
<li>return value <em>(floating point)</em>: mod(t,period)/period
</li>
</ul>
</p>
</dd>
<dt><strong><code>phase( t, period, t0 )</code></strong></dt>
<dd>Returns the phase of an offset value within a period.
The reference value <code>t0</code> corresponds to phase zero.
<p>For positive period, the returned value is in the range [0,1).
<ul>
<li><code>t</code> <em>(floating point)</em>: value
</li>
<li><code>period</code> <em>(floating point)</em>: folding period
</li>
<li><code>t0</code> <em>(floating point)</em>: reference value, corresponding to phase zero
</li>
<li>return value <em>(floating point)</em>: phase(t-t0, period)
</li>
</ul>
</p>
</dd>
<dt><strong><code>phase( t, period, t0, phase0 )</code></strong></dt>
<dd>Returns the offset phase of an offset value within a period.
The reference value <code>t0</code> corresponds to integer phase
value, and the phase offset <code>phase0</code> determines the
starting value for the phase range.
<p>For positive period, the returned value is in the range
[<code>phase0</code>,<code>phase0+1</code>).
<ul>
<li><code>t</code> <em>(floating point)</em>: value
</li>
<li><code>period</code> <em>(floating point)</em>: folding period
</li>
<li><code>t0</code> <em>(floating point)</em>: reference value, corresponding to phase zero
</li>
<li><code>phase0</code> <em>(floating point)</em>: offset for phase
</li>
<li>return value <em>(floating point)</em>: offset phase
</li>
</ul>
</p>
</dd>
</dl>
</p>
<hr><a href="uk.ac.starlink.ttools.func.TrigDegrees.html">Next</a> <a href="uk.ac.starlink.ttools.func.Arrays.html">Previous</a> <a href="staticMethods.html">Up</a> <a href="index.html">Contents</a> <br> <b>Next: </b><a href="uk.ac.starlink.ttools.func.TrigDegrees.html">TrigDegrees</a><br>
<b>Up: </b><a href="staticMethods.html">Functions</a><br>
<b>Previous: </b><a href="uk.ac.starlink.ttools.func.Arrays.html">Arrays</a><br>
<hr><i>STILTS - Starlink Tables Infrastructure Library Tool Set<br>Starlink User Note256<br>STILTS web page:
<a href="http://www.starlink.ac.uk/stilts/">http://www.starlink.ac.uk/stilts/</a><br>Author email:
<a href="mailto:m.b.taylor@bristol.ac.uk">m.b.taylor@bristol.ac.uk</a><br>Mailing list:
<a href="mailto:topcat-user@jiscmail.ac.uk">topcat-user@jiscmail.ac.uk</a><br></i></body>
</html>
|