Compile::ccon
Details
-
- This message is generated when an expression to be compiled contains a symbol with the Constant attribute that does not evaluate to a number and does not have any rules for computing numerical approximations using N. If a symbol to be compiled must have the Constant attribute, compilation can proceed without error if the symbol also has a rule for numerical approximation using N.
- Off[message] switches off the message; On[message] switches it on. For example: Off[Compile::ccon].
Examples
Basic Examples (1)
There is a symbol to be compiled that has the Constant attribute but no NValues:
Block[{c},
SetAttributes[c, Constant];
Compile[{x}, c Sin[x]]
]The numerical value of the constant is incorporated into the resulting expression:
cf = Block[{c},
SetAttributes[c, Constant];
N[c] = 5.7;
Compile[{x}, c Sin[x]]
]cf[Pi / 2]Clear[cf]