303 ///@} |
303 ///@} |
304 |
304 |
305 ///Returns zero |
305 ///Returns zero |
306 static Value zero() {return 0;} |
306 static Value zero() {return 0;} |
307 }; |
307 }; |
|
308 |
|
309 |
|
310 ///Long integer specialization of \ref Tolerance. |
|
311 |
|
312 ///Long integer specialization of \ref Tolerance. |
|
313 ///\sa Tolerance |
|
314 template<> |
|
315 class Tolerance<long int> |
|
316 { |
|
317 public: |
|
318 ///\e |
|
319 typedef long int Value; |
|
320 |
|
321 ///\name Comparisons |
|
322 ///See \ref Tolerance for more details. |
|
323 |
|
324 ///@{ |
|
325 |
|
326 ///Returns \c true if \c a is \e surely strictly less than \c b |
|
327 static bool less(Value a,Value b) { return a<b;} |
|
328 ///Returns \c true if \c a is \e surely different from \c b |
|
329 static bool different(Value a,Value b) { return a!=b; } |
|
330 ///Returns \c true if \c a is \e surely positive |
|
331 static bool positive(Value a) { return 0<a; } |
|
332 ///Returns \c true if \c a is \e surely negative |
|
333 static bool negative(Value a) { return 0>a; } |
|
334 ///Returns \c true if \c a is \e surely non-zero |
|
335 static bool nonZero(Value a) { return a!=0;}; |
|
336 |
|
337 ///@} |
|
338 |
|
339 ///Returns zero |
|
340 static Value zero() {return 0;} |
|
341 }; |
|
342 |
|
343 ///Unsigned long integer specialization of \ref Tolerance. |
|
344 |
|
345 ///Unsigned long integer specialization of \ref Tolerance. |
|
346 ///\sa Tolerance |
|
347 template<> |
|
348 class Tolerance<unsigned long int> |
|
349 { |
|
350 public: |
|
351 ///\e |
|
352 typedef unsigned long int Value; |
|
353 |
|
354 ///\name Comparisons |
|
355 ///See \ref Tolerance for more details. |
|
356 |
|
357 ///@{ |
|
358 |
|
359 ///Returns \c true if \c a is \e surely strictly less than \c b |
|
360 static bool less(Value a,Value b) { return a<b;} |
|
361 ///Returns \c true if \c a is \e surely different from \c b |
|
362 static bool different(Value a,Value b) { return a!=b; } |
|
363 ///Returns \c true if \c a is \e surely positive |
|
364 static bool positive(Value a) { return 0<a; } |
|
365 ///Returns \c true if \c a is \e surely negative |
|
366 static bool negative(Value) { return false; } |
|
367 ///Returns \c true if \c a is \e surely non-zero |
|
368 static bool nonZero(Value a) { return a!=0;}; |
|
369 |
|
370 ///@} |
|
371 |
|
372 ///Returns zero |
|
373 static Value zero() {return 0;} |
|
374 }; |
308 |
375 |
309 #if defined __GNUC__ && !defined __STRICT_ANSI__ |
376 #if defined __GNUC__ && !defined __STRICT_ANSI__ |
310 |
377 |
311 ///Long long integer specialization of \ref Tolerance. |
378 ///Long long integer specialization of \ref Tolerance. |
312 |
379 |