Linepicks - do they give same result on all PCs
Blitz3D Forums/Blitz3D Programming/Linepicks - do they give same result on all PCs
| ||
Simple question: If I have the same mesh being used on two separate PCs, and perform a linepick against it using the same parameters on both PCs will it return the same values for Pickedy(),pickedx(),pickedz()? Or to put it another way - do floating point calculations give the same result on different processors? |
| ||
They should (plus or minus the infamous "pentium bug" ;) ) |
| ||
Put up some test code using large numbers (to allow for more probability of floating point rounding issues). Then have varius people test it. I think that most computers will return the same result but it shouldn't be relied upon. |
| ||
with floating point you don't test for equality, you test with an epsilon value, so instead of saying is a=b (where a and b are floats) you'd do (a-b)<0.5 where the 0.5 is a value your games engine works with. That way you'll avoid accuracy problems. |
| ||
Could people run the code below for me and send me the file as an attachment in an email to gezeder@... Thanks myfile=writefile("test.txt") a#=5.0 b#=2.0 c#=3.0 for i=1 to 100 writefloat myfile,float(i)*sqr(a#*a#/float(i)+b#*b#+c#*c#*float(i)) writefloat myfile,float(i)*sin(float(i)) next closefile myfile |
| ||
I'll just give yah the numbers Oh, and if others just want to pust them: a#=5.0 b#=2.0 c#=3.0 For i=1 To 100 DebugLog Float(i)*Sqr(a#*a#/Float(i)+b#*b#+c#*c#*Float(i)) DebugLog Float(i)*Sin(Float(i)) Next Stop ;so you can copy/paste |
| ||
My results. |
| ||
|
| ||
How do I put this in one of those snazzy table thingy mi jigs??? EDIT : Cheers :o) 3Ghz Pentium |
| ||
Hmmm.......the results seem to be pretty well the same (cant be arsed to do a full for-number check between sources...or let alone code one up, but they look pretty-well the same to me anyway. Oh, btw, on an AMD Athlon XP1800+ processor here. (psst, Rhyolite, look over here) |
| ||
For future compatibility, I wouldn't rely on this if I were you. |
| ||
I would prefer to receive the numbers not in string format. I have found that Blitz does not return the same values on various pcs when they are converted to strings. So if I could just have the test.txt file and then do a file comparison on the bytes present in the file that would be appreciated. |
| ||
|