Archived

This topic is now archived and is closed to further replies.

LoreKeeper

Array Seizure Freed

Recommended Posts

Okay... I finally got around that annoying Look-Up table bug I was worrying about (Earlier Topic: Array Sentry) - it wasn''t the actual look-up that killed my PC though, it was the indexing - nope didn''t go out of bounds or anything: int_var := sqrtTable[ trunc(real_var) ]; ItZ completely clean... but for some reason the "trunc" function does not work properly under all circumstances, infact trying to int_var:=trunc(3.4); would kill the PC as well - it throws me an "Invalid floating point operation" exception. Turns out that changing to: int_var := sqrtTable[ round(real_var) ]; works without problems... Anybody got a clue why? thanks A-Lore

Share this post


Link to post
Share on other sites
I went looking through the source to see how Trunc() worked but all I found was assembly and since I do not understand Intel assembly, especially the FPU instructions, I was completely lost. So unfortunately, no answer.

Steve ''Sly'' Williams  Code Monkey  Krome Studios

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The Trunc Source??

*gosh* - hmmm... here''s a novel thought. I didn''t realize that it must be around somewhere, yea... - hey Sly - where can I find it?

txy...
A-Lore

Share this post


Link to post
Share on other sites
Thanks Sly

I''ll try and kick some source code sooner or later.

Woohooo! - managed to get some very basic quadtree to work. Hectic shmectic. I''d probably have managed much quicker, if I hadn''t been adamant about using certain techniques... But things are slowly speeding up.

A-Lore

Share this post


Link to post
Share on other sites
If you want to see where a procedure or a function is defined simply press CTRL and doubleclick on the functionname.

And Trunc seems to mess up a lot of things, it produced blue screens of death in a D3D App ... (only under WinXX).

Seems to mess up with the fpu.

Share this post


Link to post
Share on other sites
Hey AmpMan!

good to see you up-n-about again. You seem to be pretty busy with that University work or - ...or something special...

Ya... that blasted Trunc function... - I''ve decided to just give it a very general avoidance. WhatZ the world coming to, when you can''t even trust a procedure to drop away the comma-bits correctly...

cyaZ allz
A-Lore

Share this post


Link to post
Share on other sites