Changeset 77a321c


Ignore:
Timestamp:
Oct 11, 2009, 12:32:05 PM (14 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
76fc277
Parents:
5f4fd2f
Message:

src/aubio_priv.h: IS_DENORMAL also for negative ones, CEIL_DENORMAL for anything below 2.e-42

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/aubio_priv.h

    r5f4fd2f r77a321c  
    198198#define VERY_SMALL_NUMBER 2.e-42 //1.e-37
    199199
    200 #define IS_DENORMAL(f) f < VERY_SMALL_NUMBER
    201 
     200/** if ABS(f) < VERY_SMALL_NUMBER, returns 1, else 0 */
     201#define IS_DENORMAL(f) ABS(f) < VERY_SMALL_NUMBER
     202
     203/** if ABS(f) < VERY_SMALL_NUMBER, returns 0., else f */
    202204#define KILL_DENORMAL(f)  IS_DENORMAL(f) ? 0. : f
    203 #define CEIL_DENORMAL(f)  IS_DENORMAL(f) ? VERY_SMALL_NUMBER : f
     205
     206/** if f > VERY_SMALL_NUMBER, returns f, else returns VERY_SMALL_NUMBER */
     207#define CEIL_DENORMAL(f)  f < VERY_SMALL_NUMBER ? VERY_SMALL_NUMBER : f
    204208
    205209#define SAFE_LOG10(f) LOG10(CEIL_DENORMAL(f))
Note: See TracChangeset for help on using the changeset viewer.