PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/cln-1.3.2/src/float/sfloat/elem/cl_SF_uminus.cc

#
C++ | 28 lines | 13 code | 9 blank | 6 comment | 1 complexity | 68395d08ac10ded293687deb66865695 MD5 | raw file
Possible License(s): GPL-2.0
  1. // unary operator -
  2. // General includes.
  3. #include "base/cl_sysdep.h"
  4. // Specification.
  5. #include "cln/sfloat.h"
  6. // Implementation.
  7. #include "float/sfloat/cl_SF.h"
  8. #include "base/cl_inline.h"
  9. #include "float/sfloat/elem/cl_SF_zerop.cc"
  10. namespace cln {
  11. const cl_SF operator- (const cl_SF& x)
  12. {
  13. // Methode:
  14. // Falls x=0.0, fertig. Sonst Vorzeichenbit umdrehen.
  15. if (zerop_inline(x))
  16. return SF_0;
  17. return cl_SF_from_word(x.word ^ ((cl_uint)1 << SF_sign_shift));
  18. }
  19. } // namespace cln