isodd: a pedestrian parity checker

버전 1.7.0.0 (2.58 KB) 작성자: us
ISODD returns TRUE for integers of any numeric MATLAB class that are not evenly divisible by 2
다운로드 수: 2.3K
업데이트 날짜: 2009/8/14

라이선스 보기

ISODD returns TRUE for members (N) of a numeric array, which
- are within the range of ±bitmax
- are integers such that N == fix(N)
- are integers not evenly divisible by 2

Unlike the typical computational approach using REM/MOD,
ISODD produces a not-valid flag for numbers, which are
1) not an integer
2) larger than the maximum possible double precision
integer representation (±bitmax)
and does never return their parity as being odd

REM/MOD, on the other hand, do not complain if an input
is not a valid candidate for being even or odd at all
and, therefore, are NOT reliable parity checkers

see
> help isodd
for usage and a brief example for this small utility

인용 양식

us (2024). isodd: a pedestrian parity checker (https://www.mathworks.com/matlabcentral/fileexchange/24278-isodd-a-pedestrian-parity-checker), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.7.0.0

change in the help section; version tag 14-Aug-2009 20:35:23

1.6.0.0

any integer input now is typecast to double before testing; version tag 13-Aug-2009 23:18:39

1.5.0.0

user request: ND arrays now return the results encapsulated in cells; version tag 29-May-2009 21:36:47

1.3.0.0

help/example section reorganized; version tag 29-May-2009 15:03:56

1.2.0.0

changed the output TFODD to mark valid odd integers only; thus, the syntax vec(tfodd&tferr) now is simply vec(tfodd) for odd and vec(~tfodd&tferr) for even integers; version tag 28-May-2009 22:43:42

1.1.0.0

an annoying typo was corrected

1.0.0.0