task_id
stringclasses
161 values
condition
stringclasses
10 values
entry_point
stringclasses
155 values
code
stringlengths
41
2.13k
spec
stringclasses
161 values
oracle_pass
bool
2 classes
mutation_site
stringclasses
15 values
mutation_from
stringclasses
3 values
difficulty
stringclasses
0 values
contest_date
stringclasses
0 values
judge
stringclasses
5 values
judge_model
stringclasses
5 values
prompt_variant
stringclasses
2 values
rep
int64
0
2
said_correct
bool
2 classes
confidence
int64
0
100
quality
int64
0
5
reason
stringlengths
59
4.93k
json_mode
stringclasses
3 values
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
claude
anthropic/claude-haiku-4.5
default
2
false
95
2
The implementation fails for positive numbers less than 1 and for the case when val equals exactly 1. For example, closest_integer('0.5') returns -1 instead of 1, and closest_integer('1.5') returns 1 instead of 2. The condition 'if val > 1' should be 'if val > 0' to correctly round away from zero for all positive numbe...
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
0
false
90
2
The implementation fails for positive numbers less than 1 (e.g., '0.5' should round to 1 away from zero, but the condition 'val > 1' incorrectly returns int(val) - 1 = -1). It also incorrectly handles negative numbers with fractional part -0.5 (e.g., '-0.5' should round to -1, but the condition 'val > 1' leads to the e...
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
1
false
90
2
The implementation fails for positive numbers less than 1 (e.g., '0.5') because the condition 'val > 1' incorrectly handles the rounding away from zero rule, and it also fails for negative numbers due to the same flawed logic and incorrect handling of the round function's behavior.
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
2
false
95
2
The implementation fails for values between 0 and 1, such as '0.5', where it incorrectly returns -1 instead of 1 due to the condition 'val > 1' instead of checking for positive values.
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
gpt
openai/gpt-5.1
default
0
false
95
2
The special handling for .5 values is wrong for negative numbers. For example, closest_integer("-0.5") should return -1 (away from zero), but this code returns 0 because it uses int(-0.5) - 1 → -1 only if val <= 1, and its branch condition `if val > 1` is incorrect; also -0.5 is equidistant and should be handled explic...
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
gpt
openai/gpt-5.1
default
1
false
86
3
The implementation correctly handles most numbers and the away-from-zero behavior for .5 cases, but it incorrectly uses the condition `if val > 1` when deciding the direction of rounding for equidistant values. For inputs between 0 and 1 such as '0.5', it returns 0 instead of 1, so it does not fully satisfy the specifi...
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
gpt
openai/gpt-5.1
default
2
false
94
2
The special handling for .5 values is incorrect for negative numbers between -1 and 0: for example closest_integer("-0.5") should return -1 (away from zero), but this implementation returns 0 due to the condition `if val > 1:` instead of checking sign or magnitude.
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
0
false
1
0
The implementation does not correctly handle the case when the input number is equidistant from two integers and is negative. For example, closest_integer('-14.5') should return -15, but the implementation returns -14.
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
1
false
1
0
The implementation does not correctly handle the case when the input number is equidistant from two integers and is negative. For example, closest_integer('-14.5') should return -15, but the implementation returns -14.
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
2
false
1
0
The implementation does not handle the case when the input number is equidistant from two integers correctly for negative numbers. For example, closest_integer('-14.5') should return -15, but the implementation returns -14.
json_schema
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
0
false
95
2
The implementation incorrectly handles the case for negative numbers equidistant from two integers; the condition 'if val > 1' fails for values like -14.5, causing it to return -15 incorrectly as -14 instead of -15 due to flawed logic.
json_object
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
1
false
95
2
The implementation incorrectly handles the case for negative numbers equidistant from two integers; the condition 'if val > 1' fails for negative numbers like -14.5, causing it to return -15 incorrectly as -14 instead of -15 due to flawed logic.
json_object
HumanEval/99
mut_offbyone
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
int+1
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
2
false
95
2
The implementation incorrectly handles the case for negative numbers equidistant from two integers; the condition 'if val > 1' fails for values like -14.5, causing it to return -15 incorrectly as -14 instead of -15 due to flawed logic.
json_object
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
claude
anthropic/claude-haiku-4.5
default
0
false
95
2
The implementation fails for negative numbers equidistant from two integers. For closest_integer('-14.5'), it returns -14 instead of -15 because the formula '1 - int(val)' is incorrect; it should be 'int(val) - 1' to round away from zero for negative values.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
claude
anthropic/claude-haiku-4.5
default
1
false
95
2
The implementation fails for negative numbers equidistant from two integers. For closest_integer('-14.5'), it returns -14 instead of -15 because the formula '1 - int(val)' is incorrect; it should be 'int(val) - 1' to round away from zero for negative values.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
claude
anthropic/claude-haiku-4.5
default
2
false
95
2
The implementation fails for negative numbers equidistant from two integers. For closest_integer('-14.5'), it returns -14 instead of -15 because the formula '1 - int(val)' is incorrect; it should be 'int(val) - 1' to round away from zero for negative values.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
0
false
95
2
The implementation fails for negative numbers when the fractional part is exactly 0.5 because the logic '1 - int(val)' incorrectly computes the result; for example, closest_integer('-14.5') should return -15, but the function returns 15 instead.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
1
false
95
2
The implementation fails for negative numbers when equidistant from two integers because the logic '1 - int(val)' is incorrect; for example, closest_integer('-14.5') returns -13 instead of -15.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
2
false
90
2
The implementation fails for negative numbers when equidistant from two integers because the logic '1 - int(val)' is incorrect; for example, for -14.5, int(val) is -14, and 1 - (-14) equals 15, not the required -15. It also incorrectly handles cases like -0.5, where int(val) is 0, and 1 - 0 equals 1, not -1.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
gpt
openai/gpt-5.1
default
0
false
95
2
The tie-breaking logic for negative half-integers is incorrect: for values like '-14.5' it returns 15 instead of -15, because it uses '1 - int(val)' instead of rounding further from zero. Non-tie cases work, but the core away-from-zero requirement at .5 boundaries is violated for negative inputs.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
gpt
openai/gpt-5.1
default
1
false
94
2
Logic for negative .5 values is incorrect: for -14.5 the function returns 15 instead of -15 because it uses `1 - int(val)` instead of rounding further from zero. All other non-.5 and positive .5 cases behave correctly, but this violates the away-from-zero requirement for negative equidistant inputs.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
gpt
openai/gpt-5.1
default
2
false
95
2
The custom tie-breaking logic is wrong for negative half-integers. For val = -14.5, it returns 15 (since 1 - int(-14.5) = 1 - (-14) = 15) instead of -15, so it does not round away from zero as required.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
0
true
1
1
The implementation correctly handles the rounding logic as specified. It first checks if the decimal part is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it then checks the sign of the number and rounds away from zero accordingly.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
1
true
1
1
The implementation correctly handles the rounding logic as specified. It first checks if the decimal part is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it then checks the sign of the number and rounds away from zero accordingly.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
2
true
1
1
The implementation correctly handles the rounding logic as specified. It first checks if the decimal part is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it then checks the sign of the number and rounds away from zero accordingly.
json_schema
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
0
false
95
2
The implementation incorrectly handles negative numbers: for -14.5, it returns 1 - int(-14.5) = 15, which is wrong; it should return -15. The logic for negative numbers is flawed.
json_object
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
1
false
100
2
The implementation incorrectly handles negative numbers: for '-14.5', it returns 1 - int(-14.5) = 15, which is wrong; it should return -15. The logic for negative numbers is flawed.
json_object
HumanEval/99
mut_swap
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
false
binop-Sub
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
2
false
100
2
The implementation incorrectly handles negative numbers: for -14.5, it returns 1 - int(-14.5) = 15, which is wrong; it should return -15. The logic for negative numbers is flawed.
json_object
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
claude
anthropic/claude-haiku-4.5
default
0
false
85
2
The implementation fails for negative numbers that are equidistant from two integers. For example, closest_integer('-14.5') returns -14 instead of -15 because int(-14.5) equals -14 in Python, so int(val) - 1 gives -15 but the logic is flawed. Actually, testing: int(-14.5) = -14, so int(val) - 1 = -15, which is correct....
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
claude
anthropic/claude-haiku-4.5
default
1
false
85
2
The implementation fails for negative numbers that are equidistant from two integers. For example, closest_integer('-14.5') returns -14 instead of -15 because int(-14.5) equals -14 in Python, so int(val) - 1 gives -15 but the logic is flawed. Actually, testing: int(-14.5) = -14, so int(val) - 1 = -15, which is correct....
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
claude
anthropic/claude-haiku-4.5
default
2
false
85
2
The implementation fails for negative numbers that are equidistant from two integers. For example, closest_integer('-14.5') returns -14 instead of -15 because int(-14.5) equals -14 in Python, so int(val) - 1 gives -15 but the logic is flawed. Actually, testing: int(-14.5) = -14, so int(val) - 1 = -15, which is correct....
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
0
false
90
3
The implementation fails for negative numbers with fractional part not equal to 0.5 because it uses Python's round() which rounds to nearest even, not away from zero for equidistant cases, and the custom logic only activates for exactly 0.5.
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
1
true
100
5
The implementation correctly converts the string to a float, handles standard rounding to the nearest integer, and specifically rounds away from zero when the fractional part is exactly 0.5, as required by the specification.
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
2
true
100
5
The implementation correctly handles all cases: it converts the string to a float, rounds to the nearest integer using standard rounding for non-midpoints, and explicitly rounds away from zero for the equidistant case (0.5 or -0.5).
json_object
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
gpt
openai/gpt-5.1
default
0
true
95
5
The function correctly parses the string to float, computes the nearest integer, and handles .5 ties by rounding away from zero for both positive and negative numbers while deferring to built-in round for non-tie cases. This matches the specification’s examples and tie-breaking rule for all valid numeric string inputs.
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
gpt
openai/gpt-5.1
default
1
false
90
3
The approach of special-casing .5 values to round away from zero is conceptually correct, but it relies on float and round() semantics, which can mis-handle decimal strings that are not exactly representable in binary (e.g. '2.675'), causing values that are mathematically at .5 not to be treated as such. Therefore, it ...
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
gpt
openai/gpt-5.1
default
2
false
90
3
The implementation uses Python's built-in round for non-.5 cases, which rounds ties to even rather than away from zero, violating the specified behavior for values like '1.5' or '2.5'; it only correctly handles exactly .5 fractional parts, not other tie cases or the general rounding rule.
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
0
true
1
1
The candidate implementation correctly handles the rounding logic as specified. It first checks if the decimal part of the number is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it then checks the sign of the number and rounds away from zero accordingly. This implemen...
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
1
true
1
1
The implementation correctly handles the rounding logic as specified. It first checks if the decimal part is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it then checks the sign of the number and rounds away from zero accordingly.
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
2
true
1
1
The candidate implementation correctly handles the rounding logic as specified. It first checks if the decimal part is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it then checks the sign of the number and rounds away from zero accordingly. The function also correctly...
json_schema
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
0
true
100
5
The implementation correctly handles both regular rounding and the special case of equidistant values by rounding away from zero, as demonstrated by the logic for .5 cases and verified with the provided examples.
json_object
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
1
true
100
5
The implementation correctly handles both regular rounding and the special case of equidistant values by rounding away from zero, as demonstrated by the logic for .5 cases and verified with the provided examples.
json_object
HumanEval/99
reformat
closest_integer
def closest_integer(value): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
2
true
100
5
The implementation correctly handles both regular rounding and the special case of equidistant values by rounding away from zero, as demonstrated by the logic for .5 cases and verified with the provided examples.
json_object
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
claude
anthropic/claude-haiku-4.5
default
0
true
95
4
The implementation correctly handles all specified cases: it converts the string to float, checks if the fractional part is exactly 0.5, and rounds away from zero in that case while using standard rounding otherwise. The logic properly distinguishes positive and negative numbers for the away-from-zero rounding rule.
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
claude
anthropic/claude-haiku-4.5
default
1
true
95
4
The implementation correctly handles all specified cases: it converts the string to float, checks if the fractional part is exactly 0.5, and rounds away from zero in that case while using standard rounding otherwise. The logic properly distinguishes positive and negative numbers for the away-from-zero rounding rule.
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
claude
anthropic/claude-haiku-4.5
default
2
true
95
4
The implementation correctly handles all specified cases: it converts the string to float, checks if the fractional part is exactly 0.5, and rounds away from zero in that case while using standard rounding otherwise. The logic properly distinguishes positive and negative numbers for the away-from-zero rounding rule.
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
0
false
95
3
The implementation fails for negative numbers that are not equidistant from two integers because it uses Python's round() which rounds to nearest even, not away from zero for all cases. For example, closest_integer('-15.3') should return -15, but round(-15.3) returns -15 only because -15.3 is not a tie; however, the sp...
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
1
false
95
3
The implementation fails for negative numbers that are not equidistant from two integers because it uses Python's round() which rounds to nearest even, not away from zero. For example, closest_integer('-15.3') returns -15 instead of -15, but round(-15.3) gives -15, which is correct for this case, but the specification ...
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
2
true
100
4
The implementation correctly handles all cases: it converts the string to float, rounds to the nearest integer, and for the equidistant case (fractional part 0.5), it rounds away from zero as specified.
json_object
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
gpt
openai/gpt-5.1
default
0
true
94
5
The function correctly parses the string to float, detects the .5 fractional case via abs(v1 - int(v1)) == 0.5, and uses round() otherwise. In non-.5 cases Python’s round matches standard nearest-integer rounding, and in .5 cases the custom logic rounds away from zero as required, including for negative values and inte...
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
gpt
openai/gpt-5.1
default
1
true
96
5
The function correctly converts the string to float, checks for the .5 fractional case, and rounds away from zero in that case; otherwise it relies on Python’s round, which matches the usual closest-integer behavior for non-.5 fractions. Edge cases like negative .5 values and integer inputs behave as specified.
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
gpt
openai/gpt-5.1
default
2
true
94
5
The function correctly parses the string as float, uses standard rounding when not exactly .5 from an integer, and for .5 cases rounds away from zero as specified, including negative values. It handles all valid numeric string inputs as required by the task.
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
0
true
1
0
The implementation correctly handles the rounding logic as specified. It first checks if the decimal part is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it then checks the sign of the number and rounds away from zero accordingly.
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
1
true
1
0
The implementation correctly handles the rounding logic as specified. It first checks if the decimal part is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it then checks the sign of the number and rounds away from zero accordingly.
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
2
true
100
4
The implementation correctly handles the rounding logic, including the case where the number is equidistant from two integers, and it does so in a straightforward and efficient manner. However, the use of a nested function and the variable names could be improved for better readability and maintainability.
json_schema
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
0
true
100
5
The implementation correctly handles both regular rounding and the special case of equidistant values by rounding away from zero, as demonstrated by the logic for .5 cases and the use of float conversion and int truncation.
json_object
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
1
true
100
5
The implementation correctly handles both regular rounding and the special case of .5 by rounding away from zero, as demonstrated by the logic for positive and negative numbers. It accurately converts the string to float and applies the specified rounding rules.
json_object
HumanEval/99
rename
closest_integer
def closest_integer(v2): """ Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 ...
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
2
true
100
5
The implementation correctly handles both regular rounding and the special case of .5 by rounding away from zero, as demonstrated by the logic for positive and negative numbers. It accurately converts the string to float and applies the specified rounding rules.
json_object
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
claude
anthropic/claude-haiku-4.5
default
0
false
85
2
The implementation fails for negative numbers where the fractional part is exactly 0.5. For example, closest_integer('-14.5') returns -14 instead of -15 because int(-14.5) equals -14 in Python, not -15. The logic doesn't account for how Python's int() function truncates toward zero for negative numbers.
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
claude
anthropic/claude-haiku-4.5
default
1
false
85
2
The implementation fails for negative numbers where the fractional part is exactly 0.5. For example, closest_integer('-14.5') returns -14 instead of -15 because int(-14.5) equals -14 in Python, not -15. The logic doesn't account for how Python's int() function truncates toward zero for negative numbers.
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
claude
anthropic/claude-haiku-4.5
default
2
false
85
2
The implementation fails for negative numbers where the fractional part is exactly 0.5. For example, closest_integer('-14.5') returns -14 instead of -15 because int(-14.5) equals -14 in Python, not -15. The logic doesn't account for how Python's int() function truncates toward zero for negative numbers.
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
0
false
95
4
The implementation fails for negative numbers with fractional part exactly 0.5 because int(val) for negative val truncates toward zero, leading to incorrect rounding away from zero. For example, closest_integer('-14.5') should return -15, but the function returns -14.
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
1
false
90
3
The implementation fails for negative numbers with fractional part exactly 0.5 because int(val) for negative val truncates toward zero, leading to incorrect rounding away from zero. For example, closest_integer('-14.5') should return -15, but the function returns -14.
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
deepseek
deepseek/deepseek-v3.2-exp
default
2
false
90
4
The implementation fails for negative numbers with fractional part exactly 0.5 because int(val) for negative val truncates towards zero, leading to incorrect rounding away from zero. For example, closest_integer('-14.5') should return -15, but the function returns -14.
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
gpt
openai/gpt-5.1
default
0
true
96
5
The implementation correctly parses the string to float and rounds to the nearest integer, handling .5 ties by checking the fractional part and rounding away from zero for both positive and negative values, matching the specification for all valid numeric string inputs.
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
gpt
openai/gpt-5.1
default
1
true
94
4
The implementation correctly converts the string to float, then rounds to the nearest integer, and handles .5 ties by checking for a 0.5 fractional part in absolute value and rounding away from zero. For typical decimal-like inputs this matches the specification, though floating-point representation edge cases could th...
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
gpt
openai/gpt-5.1
default
2
true
94
5
The implementation correctly parses the string to float, uses standard rounding when not exactly at .5, and for .5 cases it rounds away from zero as required. Edge cases like negative halves are handled properly by the custom logic, so it matches the specification for valid numeric string inputs.
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
0
true
1
1
The candidate implementation correctly handles the rounding logic as specified. It first checks if the decimal part of the number is not 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it then checks the sign of the number and rounds away from zero accordingly. This implementation ma...
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
1
true
1
1
The implementation correctly handles the rounding logic as specified. It checks if the decimal part is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it rounds away from zero by adding 1 if the number is positive and subtracting 1 if the number is negative. This logic i...
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
llama
meta-llama/llama-3.3-70b-instruct
default
2
true
1
1
The candidate implementation correctly handles the rounding logic as specified. It checks if the decimal part is not equal to 0.5, in which case it uses the built-in round function. If the decimal part is 0.5, it rounds away from zero by adding 1 for positive numbers and subtracting 1 for negative numbers. The function...
json_schema
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
0
true
100
5
The implementation correctly handles both regular rounding and the special case of equidistant values by rounding away from zero, as demonstrated by the logic for .5 cases and the use of float conversion and int truncation.
json_object
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
1
true
100
5
The implementation correctly handles both regular rounding and the special case of equidistant values by rounding away from zero, as demonstrated by the logic for .5 cases and the use of float conversion and int truncation.
json_object
HumanEval/99
strip_docstring
closest_integer
def closest_integer(value): def rounding(val): if abs(val - int(val)) != 0.5: return round(val) if val > 0: return int(val) + 1 else: return int(val) - 1 return rounding(float(value))
Create a function that takes a value (string) representing a number and returns the closest integer to it. If the number is equidistant from two integers, round it away from zero. Examples >>> closest_integer("10") 10 >>> closest_integer("15.3") 15 Note: Rounding away from zer...
true
null
null
null
null
qwen
qwen/qwen3-next-80b-a3b-instruct
default
2
true
100
5
The implementation correctly handles rounding away from zero for equidistant cases by checking if the fractional part is exactly 0.5 and then adjusting the integer part accordingly, while using round() for all other cases, which matches the specification.
json_object