Ignore:
Timestamp:
Jul 13, 2005, 7:45:47 PM (17 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • src/math.c src/bitmap.c src/caca.h Removed powf call, added caca_powf, to remove libm depencies and problems on old compilers/linkers.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/math.c

    r298 r495  
    7979}
    8080
     81
     82/**
     83 * \brief powf substitute (x^y)
     84 * \param x The value to be raised
     85 * \param y The power to raise x of.
     86 * \return \p x raised to the power of \p y
     87 */
     88
     89float caca_powf(float x, float y)
     90{
     91    int i=((int)y);
     92    float r=x;
     93
     94    if(((int)y)==1 || ((int)x)==1)
     95        return x;
     96
     97    i--;
     98    while(i--)
     99    {
     100        r*=x;
     101    }
     102    return r;
     103}
Note: See TracChangeset for help on using the changeset viewer.