Mercurial > octave
comparison libinterp/corefcn/data.cc @ 21540:ffb4770ba079
Make median preserve discrete types (bug #47515).
* median.m: Replace mean by "native" sum (or max for logical), and
avoid assigning NaN to non-float types.
* data.cc (Fnth_element): Allow type bool, treated as an integer.
author | Lachlan Andrew <lachlanbis@gmail.com> |
---|---|
date | Thu, 24 Mar 2016 13:35:40 +1100 |
parents | 348e335c49dd |
children | ad0599a0acc6 |
comparison
equal
deleted
inserted
replaced
21539:212bafe8413a | 21540:ffb4770ba079 |
---|---|
6927 MAKE_INT_BRANCH (int64); | 6927 MAKE_INT_BRANCH (int64); |
6928 MAKE_INT_BRANCH (uint8); | 6928 MAKE_INT_BRANCH (uint8); |
6929 MAKE_INT_BRANCH (uint16); | 6929 MAKE_INT_BRANCH (uint16); |
6930 MAKE_INT_BRANCH (uint32); | 6930 MAKE_INT_BRANCH (uint32); |
6931 MAKE_INT_BRANCH (uint64); | 6931 MAKE_INT_BRANCH (uint64); |
6932 MAKE_INT_BRANCH (bool); | |
6932 #undef MAKE_INT_BRANCH | 6933 #undef MAKE_INT_BRANCH |
6933 default: | 6934 default: |
6934 if (argx.is_cellstr ()) | 6935 if (argx.is_cellstr ()) |
6935 retval = argx.cellstr_value ().nth_element (n, dim); | 6936 retval = argx.cellstr_value ().nth_element (n, dim); |
6936 else | 6937 else |