quakeforge/tools/qfcc/test/swap.r
Bill Currie f250065003 Add tests for swapping vars and triangle area.
Triangle area was meant just to check Kahan's equation, but it found a
problem with swapping vars. swap.r currently fails.
2018-08-21 16:27:22 +09:00

15 lines
183 B
R

void printf (string fmt, ...) = #0;
float
swap (float a, float b)
{
float t;
if (a < b) { t = a; a = b; b = t; }
return a - b;
}
int
main ()
{
return swap (1, 2) > 0 ? 0 : 1;
}