Changeset 4525:07dfa64029bc in roaraudio for include/libroar/roarfloat.h


Ignore:
Timestamp:
10/16/10 22:33:14 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added generic float handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/roarfloat.h

    r4524 r4525  
    3939#include "libroar.h" 
    4040 
     41typedef uint32_t roarfloat32; 
     42 
     43#define ROAR_UFLOAT32_MAX  65535 
     44 
     45#define ROAR_UFLOAT32_ZERO ROAR_HOST2NET32(0x00000000); 
     46#define ROAR_UFLOAT32_PINF ROAR_HOST2NET32(0x00000001); 
     47#define ROAR_UFLOAT32_NINF ROAR_HOST2NET32(0x0000FFFF); 
     48#define ROAR_UFLOAT32_PNAN ROAR_HOST2NET32(0x00007FFF); 
     49#define ROAR_UFLOAT32_NNAN ROAR_HOST2NET32(0x00008000); 
     50 
     51roarfloat32 roar_ufloat32_build(const uint16_t mul, const uint16_t scale); 
     52uint16_t roar_ufloat32_scale(const roarfloat32 f); 
     53uint16_t roar_ufloat32_mul(const roarfloat32 f); 
     54 
     55roarfloat32 roar_ufloat32_from_float(const float       f); 
     56float       roar_ufloat32_to_float  (const roarfloat32 f); 
     57 
     58int roar_float32_iszero(const roarfloat32 f); 
     59int roar_float32_isinf(const roarfloat32 f); 
     60int roar_float32_isnan(const roarfloat32 f); 
     61 
    4162#endif 
    4263 
Note: See TracChangeset for help on using the changeset viewer.