![]() |
Prev | Next |
int
, float
, double
,
AD<double>
, AD< AD<double> >
.
The routine CheckNumericType
can be used to check
that a type satisfies these conditions.
NumericType
x;
creates a NumericType object
with an unspecified value.
int
,
the syntax
NumericType
x(
i);
creates a NumericType object with a value
equal to i where i can be const
.
NumericType
y(
x);
creates a NumericType object y
with the same value as x
where x can be const
.
x =
y
sets the value of x equal to the value of y
where y can be const
.
The expression corresponding to this operation is unspecified; i.e.,
it could be void
and hence
x =
y =
z
may not be legal.
const
.
In the result type column,
NumericType can be replaced by any type that can
be used just like a NumericType object.
Operation | Description | Result Type |
+ x | unary plus | NumericType |
- x | unary minus | NumericType |
x + y | binary addition | NumericType |
x - y | binary subtraction | NumericType |
x * y | binary multiplication | NumericType |
x / y | binary division | NumericType |
z += y | computed assignment addition | unspecified |
z -= y | computed assignment subtraction | unspecified |
z *= y | computed assignment multiplication | unspecified |
z /= y | computed assignment division | unspecified |
int
,
float
,
double
.
std::complex<double>
,
std::valarray<double>
,
std::vector<double>
?