Mercurial > hg > libxtract
comparison src/scalar.c @ 206:c6488df9e5c0
Add range check
author | Jamie Bullock <jamie@jamiebullock.com> |
---|---|
date | Tue, 11 Mar 2014 18:16:12 +0000 |
parents | f6fcf3bec020 |
children | d85e4b9aeb82 |
comparison
equal
deleted
inserted
replaced
205:f6fcf3bec020 | 206:c6488df9e5c0 |
---|---|
990 | 990 |
991 note = 69 + log(f0 / 440.f) * 17.31234; | 991 note = 69 + log(f0 / 440.f) * 17.31234; |
992 note *= 100; | 992 note *= 100; |
993 note = round(note); | 993 note = round(note); |
994 | 994 |
995 return XTRACT_SUCCESS; | 995 if (note > 12700 || note < 0) |
996 } | 996 { |
997 | 997 return XTRACT_ARGUMENT_ERROR; |
998 } | |
999 | |
1000 return XTRACT_SUCCESS; | |
1001 } | |
1002 |