Questions tagged [evaluation]

Anything related to evaluation of expressions, i.e. the process used to determine the value of expressions in a running program.

What is it?

Evaluation is about rules, algorithms and strategies used for the evaluation of expressions or the computation of evaluation functions.

Related tags

  • The tag may be used more specifically for the execution or invocation of evaluations.
  • For more specific questions use tags such as for example

See also:

1334 questions
14
votes
2 answers

Evaluate Irrational with Julia

Julia has the built-in constant pi, with type Irrational. julia> pi π = 3.1415926535897... julia> π π = 3.1415926535897... julia> typeof(pi) Irrational{:π} Coming from SymPy, which has the N() function, I would like to evaluate pi (or other…
2Cubed
  • 3,401
  • 7
  • 23
  • 40
13
votes
1 answer

Is parameter binding sequenced after argument evaluation?

Suppose I have the following function: void foo(std::vector vec, int n); If I call the function like this: std::vector numbers { 2, 3, 5, 7, 11, 13, 17, 19 }; foo(std::move(numbers), numbers[0]); Are all the arguments completely…
fredoverflow
  • 256,549
  • 94
  • 388
  • 662
13
votes
9 answers

Tensorflow object detection evaluation pycocotools missing

Following the TF tutorial on pet object detection : https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_pets.md Ran locally :…
Frédéric Coubard
  • 141
  • 1
  • 1
  • 4
12
votes
5 answers

Using assignment as a condition expression?

Consider: if (a=5) { /* do something */ } How does the assignment work as a condition? Is it based on non-zero value of l-value?
George K Joy
  • 151
  • 1
  • 1
  • 5
12
votes
3 answers

Evaluate string with math operators

Is there an easy way to evaluate strings like "(4+8)*2" So that you'd get the int value of 24? Or is there a lot of work needed to get this done...?
Mark Lalor
  • 7,820
  • 18
  • 67
  • 106
12
votes
4 answers

Evaluating developers

I am a technical team leader of a small programming team, working on a project for an external client. I was recently asked to produce written evaluations of my team members. I feel uncomfortable doing this, because I don't see myself as a…
Mike W.
  • 121
  • 1
  • 4
12
votes
1 answer

Safely evaluating arithmetic expressions in R?

Edit Ok, since there seems to be a lot of confusion, I'm going to simplify the question a little. You can try to answer the original question below, or you can tackle this version instead and ignore everything below the line. My goal is to take an…
Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
11
votes
4 answers

C++ function evaluation order in assignment operator

int& foo() { printf("Foo\n"); static int a; return a; } int bar() { printf("Bar\n"); return 1; } void main() { foo() = bar(); } I am not sure which one should be evaluated first. I have tried in VC that bar function is executed…
Yiu Fai
  • 111
  • 1
  • 4
11
votes
4 answers

Execution order of f1() + f2()*f3() expression and operator precedence in JLS

Given an expression f1() + f2()*f3() with 3 method calls, java evaluates (operands of) addition operation first: int result = f1() + f2()*f3(); f1 working f2 working f3 working I (wrongly) expected f2() to be called first, then f3(), and finally…
11
votes
2 answers

Forced strictness for lists in haskell

I made really time consuming algorithm which produces a short string as the result. When I try to print it (via putStrLn) it appears on the screen character by character. I did understand why that happened, and I tried to force evaluation of the…
MaksymB
  • 1,267
  • 10
  • 33
11
votes
4 answers

How to write an R function that evaluates an expression within a data-frame

Puzzle for the R cognoscenti: Say we have a data-frame: df <- data.frame( a = 1:5, b = 1:5 ) I know we can do things like with(df, a) to get a vector of results. But how do I write a function that takes an expression (such as a or a > 3) and does…
Prasad Chalasani
  • 19,912
  • 7
  • 51
  • 73
11
votes
2 answers

Variation in BLEU Score

I have some question on BLUE Score calculation for machine translation. I realized they may have a different metrics for BLEU. I found the code reports five value for BLEU, namely BLEU-1, BLEU-2, BLEU-3, BLEU-4 and finally BLEU, which seems to be an…
Jürgen K.
  • 3,427
  • 9
  • 30
  • 66
11
votes
3 answers

Call-by-name in Scala vs lazy evaluation in Haskell?

Haskell's lazy evaluation will never take more evaluation steps than the eager evaluation. On the other hand, Scala's call-by-name evaluation may require more evaluation steps than call-by-value (if the short-circuit benefits are more than offset by…
max
  • 49,282
  • 56
  • 208
  • 355
11
votes
2 answers

In R, evaluate expressions within vector of strings

I wish to evaluate a vector of strings containing arithmetic expressions -- "1+2", "5*6", etc. I know that I can parse a single string into an expression and then evaluate it as in eval(parse(text="1+2")). However, I would prefer to evaluate the…
C8H10N4O2
  • 18,312
  • 8
  • 98
  • 134
11
votes
4 answers

How to build a parse tree of a mathematical expression?

I'm learning how to write tokenizers, parsers and as an exercise I'm writing a calculator in JavaScript. I'm using a prase tree approach (I hope I got this term right) to build my calculator. I'm building a tree of tokens based on operator…
bodacydo
  • 75,521
  • 93
  • 229
  • 319