if we save this short file as Trig.pmod we can now use this module like this:constant PI = 3.14159265358979323846264338327950;
float cos2(float f) { return pow(cos(f),2.0); }
or like this:int main()
{
write(sprintf("%f\n",.Trig.cos2(.Trig.PI));
}
import .Trig;
int main()
{
write(sprintf("%f\n",cos2(PI));
}