Mercurial > hg > octave-nkf
comparison liboctave/oct-inttypes.h @ 8191:9cb73236e552
fix uint64 mixed operations
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 07 Oct 2008 15:28:45 +0200 |
parents | 69c5cce38c29 |
children | 5fd507839b76 |
comparison
equal
deleted
inserted
replaced
8190:73d6b71788c0 | 8191:9cb73236e552 |
---|---|
985 operator OP (const double& x, const octave_int64& y) \ | 985 operator OP (const double& x, const octave_int64& y) \ |
986 { return octave_int64 (x OP static_cast<long double> (y.value ())); } \ | 986 { return octave_int64 (x OP static_cast<long double> (y.value ())); } \ |
987 template <> \ | 987 template <> \ |
988 inline octave_uint64 \ | 988 inline octave_uint64 \ |
989 operator OP (const double& x, const octave_uint64& y) \ | 989 operator OP (const double& x, const octave_uint64& y) \ |
990 { return octave_int64 (x OP static_cast<long double> (y.value ())); } \ | 990 { return octave_uint64 (x OP static_cast<long double> (y.value ())); } \ |
991 template <> \ | 991 template <> \ |
992 inline octave_int64 \ | 992 inline octave_int64 \ |
993 operator OP (const octave_int64& x, const double& y) \ | 993 operator OP (const octave_int64& x, const double& y) \ |
994 { return octave_int64 (static_cast<long double> (x.value ()) OP y); } \ | 994 { return octave_int64 (static_cast<long double> (x.value ()) OP y); } \ |
995 template <> \ | 995 template <> \ |
996 inline octave_uint64 \ | 996 inline octave_uint64 \ |
997 operator OP (const octave_uint64& x, const double& y) \ | 997 operator OP (const octave_uint64& x, const double& y) \ |
998 { return octave_int64 (static_cast<long double> (x.value ()) OP y); } | 998 { return octave_uint64 (static_cast<long double> (x.value ()) OP y); } |
999 | 999 |
1000 #else | 1000 #else |
1001 // external handlers | 1001 // external handlers |
1002 #define OCTAVE_INT_DOUBLE_BIN_OP(OP) \ | 1002 #define OCTAVE_INT_DOUBLE_BIN_OP(OP) \ |
1003 OCTAVE_INT_DOUBLE_BIN_OP0(OP) \ | 1003 OCTAVE_INT_DOUBLE_BIN_OP0(OP) \ |