mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-20 17:31:08 +00:00
Catch accuracy errors.
I'd forgotten to set the result flag. Unfortunately, the errors can get very bad (1e-3) it seems :(
This commit is contained in:
parent
6eec76dd49
commit
7753583bfd
1 changed files with 4 additions and 3 deletions
|
@ -72,7 +72,7 @@ main (int argc, const char **argv)
|
|||
|
||||
mtwist_seed (&mt, 0);
|
||||
start = Sys_DoubleTime ();
|
||||
for (i = 0; !res && i < 100000; i++) {
|
||||
for (i = 0; !res && i < 1000000; i++) {
|
||||
vec3_t cloud[4];
|
||||
sphere_t cc;
|
||||
vec_t r2;
|
||||
|
@ -85,14 +85,15 @@ main (int argc, const char **argv)
|
|||
r2 = cc.radius * cc.radius;
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (fabs (VectorDistance_fast (cloud[j], cc.center) - r2)
|
||||
< 1e-4 * r2)
|
||||
< 1e-3 * r2)
|
||||
continue;
|
||||
printf ("%d %.9g - %.9g = %.9g\n", (int)j,
|
||||
VectorDistance_fast (cloud[j], cc.center), r2,
|
||||
VectorDistance_fast (cloud[j], cc.center) - r2);
|
||||
printf ("[%.9g %.9g %.9g] - [%.9g %.9g %.9g] = %.9g > %.9g\n",
|
||||
printf ("[%.9g %.9g %.9g] - [%.9g %.9g %.9g] = %.9g != %.9g\n",
|
||||
VectorExpand (cloud[j]), VectorExpand (cc.center),
|
||||
VectorDistance_fast (cloud[j], cc.center), r2);
|
||||
res = 1;
|
||||
}
|
||||
}
|
||||
end = Sys_DoubleTime ();
|
||||
|
|
Loading…
Reference in a new issue