las funciones sqrt(), cos() y probablemente el resto de las funciones trigonométricas, retornar el argumento tal cual.
// Programa de testeo de las rutinas matematicas
program test_math1;
const
global
var1 = 42;
var2 = -42;
local
private
begin
if (abs(var2) != var1)
showError("error funci¢n abs()");
end
if (sqrt(10) != 3)
showError("error funci¢n sqrt()");
end
if (pow(3, 2) != 9)
showError("error funci¢n pow()");
end
if (cos(0) != 1000)
showError("error funci¢n cos(0)");
end
if (cos(90000) != 0)
showError("error funci¢n cos(90000)");
end
if (cos(180000) != -1000)
showError("error funci¢n cos(180000)");
end
if (cos(-90000) != 0)
showError("error funci¢n cos(-90000)");
end
if (cos(270000) != 0)
showError("error funci¢n cos(270000)");
end
if (sin(0) != 0)
showError("error funci¢n sin(0)");
end
if (sin(90000) != 1000)
showError("error funci¢n sin(90000)");
end
if (sin(180000) != 0)
showError("error funci¢n sin(180000)");
end
if (sin(-90000) != -1000)
showError("error funci¢n sin(-90000)");
end
if (sin(270000) != -1000)
showError("error funci¢n sin(270000)");
end
while (!key(_enter))
write(0, 0, 0, 0, "Presionar ENTER para continuar");
frame;
end
end
function showError(msg)
begin
while (!key(_enter))
write(0, 0, 20, 0, msg);
write(0, 0, 0, 0, "Presionar ENTER para continuar");
frame;
end
exit(msg, -1);
end
las funciones sqrt(), cos() y probablemente el resto de las funciones trigonométricas, retornar el argumento tal cual.
Adjunto miniprograma de testeo