def has_equal_value(state, ordered=False, ndigits=None, incorrect_msg=None):
    if not hasattr(state, "parent"):
        raise ValueError(
            "You can only use has_equal_value() on the state resulting from check_column, check_row or check_result."
        )
    if incorrect_msg is None:
        incorrect_msg = "Column `{{col}}` seems to be incorrect.{{' Make sure you arranged the rows correctly.' if ordered else ''}}"
    has_nrows(state)
    if not ordered:
        stu_res, sol_res = sort_rows(state)
    else:
        stu_res = state.student_result
        sol_res = state.solution_result
    for sol_col_name, sol_col_vals in sol_res.items():
        stu_col_vals = stu_res[sol_col_name]
        if ndigits is not None:
            try:
                sol_col_vals = round_seq(sol_col_vals, ndigits)
                stu_col_vals = round_seq(stu_col_vals, ndigits)
            except:
                pass
        if sol_col_vals != stu_col_vals:
            _msg = state.build_message(
                incorrect_msg, fmt_kwargs={"col": sol_col_name, "ordered": ordered}
            )
            state.do_test(_msg)
    return state