## liboilrandom

liboilrandom —

##

# Synopsis

    #define     oil_rand_s32                    ()
    #define     oil_rand_s32_l31                ()
    #define     oil_rand_s16                    ()
    #define     oil_rand_s16_l15                ()
    #define     oil_rand_s16_l9                 ()
    #define     oil_rand_s16_l8                 ()
    #define     oil_rand_s16_l4                 ()
    #define     oil_rand_s8                     ()
    #define     oil_rand_u32                    ()
    #define     oil_rand_u32_l31                ()
    #define     oil_rand_u16                    ()
    #define     oil_rand_u8                     ()
    #define     oil_rand_f64_0_1                ()
    #define     oil_rand_f64_s32                ()
    #define     oil_rand_f64_s16                ()
    #define     oil_rand_f64_s8                 ()
    #define     oil_rand_f64_u32                ()
    #define     oil_rand_f64_u16                ()
    #define     oil_rand_f64_u8                 ()
    #define     oil_rand_f32_0_1                ()
    #define     oil_rand_f32_s32                ()
    #define     oil_rand_f32_s16                ()
    #define     oil_rand_f32_s8                 ()
    #define     oil_rand_f32_u32                ()
    #define     oil_rand_f32_u16                ()
    #define     oil_rand_f32_u8                 ()
    #define     oil_rand_s64                    ()
    #define     oil_rand_u64                    ()

## Description

## Details

### oil_rand_s32()

    #define oil_rand_s32() ((rand()&0xffff)<<16 | (rand()&0xffff))

### oil_rand_s32_l31()

    #define oil_rand_s32_l31() (((int32_t)rand())-0x40000000)

### oil_rand_s16()

    #define oil_rand_s16() ((int16_t)(rand()&0xffff))

### oil_rand_s16_l15()

    #define oil_rand_s16_l15() (oil_rand_s16()>>1)

### oil_rand_s16_l9()

    #define oil_rand_s16_l9() (oil_rand_s16()>>7)

### oil_rand_s16_l8()

    #define oil_rand_s16_l8() (oil_rand_s16()>>8)

### oil_rand_s16_l4()

    #define oil_rand_s16_l4() (oil_rand_s16()>>12)

### oil_rand_s8()

    #define oil_rand_s8() ((int8_t)(rand()&0xffff))

### oil_rand_u32()

    #define oil_rand_u32() ((uint32_t)((rand()&0xffff)<<16 | (rand()&0xffff)))

### oil_rand_u32_l31()

    #define oil_rand_u32_l31() ((uint32_t)rand())

### oil_rand_u16()

    #define oil_rand_u16() ((uint16_t)(rand()&0xffff))

### oil_rand_u8()

    #define oil_rand_u8() ((uint8_t)(rand()&0xffff))

### oil_rand_f64_0_1()

    #define oil_rand_f64_0_1() (((rand()/(RAND_MAX+1.0))+rand())/(RAND_MAX+1.0))

### oil_rand_f64_s32()

    #define oil_rand_f64_s32() (oil_rand_f64_0_1()*4294967296.0-2147483648.0)

### oil_rand_f64_s16()

    #define oil_rand_f64_s16() (oil_rand_f64_0_1()*65536.0-32768.0)

### oil_rand_f64_s8()

    #define oil_rand_f64_s8() (oil_rand_f64_0_1()*256.0-128.0)

### oil_rand_f64_u32()

    #define oil_rand_f64_u32() (oil_rand_f64_0_1()*4294967296.0)

### oil_rand_f64_u16()

    #define oil_rand_f64_u16() (oil_rand_f64_0_1()*65536.0)

### oil_rand_f64_u8()

    #define oil_rand_f64_u8() (oil_rand_f64_0_1()*256.0)

### oil_rand_f32_0_1()

    #define oil_rand_f32_0_1() (rand()/(RAND_MAX+1.0))

### oil_rand_f32_s32()

    #define oil_rand_f32_s32() (oil_rand_f64_0_1()*4294967296.0-2147483648.0)

### oil_rand_f32_s16()

    #define oil_rand_f32_s16() (oil_rand_f64_0_1()*65536.0-32768.0)

### oil_rand_f32_s8()

    #define oil_rand_f32_s8() (oil_rand_f64_0_1()*256.0-128.0)

### oil_rand_f32_u32()

    #define oil_rand_f32_u32() (oil_rand_f64_0_1()*4294967296.0)

### oil_rand_f32_u16()

    #define oil_rand_f32_u16() (oil_rand_f64_0_1()*65536.0)

### oil_rand_f32_u8()

    #define oil_rand_f32_u8() (oil_rand_f64_0_1()*256.0)

### oil_rand_s64()

    #define oil_rand_s64() ((int64_t)(oil_rand_s32())<<32 | oil_rand_s32())

### oil_rand_u64()

    #define oil_rand_u64() ((uint64_t)(oil_rand_u32())<<32 | oil_rand_u32())