Page 1 of 1

png and pow

Posted: Tue May 15, 2007 10:08 am
by radad
I downloaded and built libpng from svn and was getting some missing references for pow and powf. I fixed the powf by adding mf to the list of libraries but I couldnt find pow anywhere in the ps2sdk. Does it exist?

As a workaround I disabled the floating point support in libpng. Is libpng still able to open all variations?

Posted: Fri May 18, 2007 12:45 pm
by radad
It seems the floating point unit in the ps2 only handles single precision floats. So what is a good strategy for handling double precision float functions like 'pow'. Would it be ok to just call the single precision version?

ie

Code: Select all

double pow(double x, double y)
{
    return powf(x, y);
}

Posted: Fri May 18, 2007 5:41 pm
by EEUG
...ogg/vorbis decoder in SMS uses 'powf' from 'ps2sdk'. Alternatively you can try to use 'pow' from 'libm' which is part of the toolchain (I think it uses emulation for the doubles)...