Thread: Safe code?
View Single Post
Old May 29th, 2006, 11:56 AM   #1
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 309
Rep Power: 4 Klarre is on a distinguished road
Safe code?

I am using this square root function from within my C++ application. But I am a little bit worried that it might not be totally fail safe. Can it in some way "screw it up" for other applications that uses the FPU at the "same" time? How should I fix it if that's so?

.586
.model flat, C

.code

sqrt proc x:DWORD
	fld x
	fsqrt
	ret

sqrt endp

end
Thanks for your help!

/Klarre
__________________
http://www.klarre.se
Klarre is offline   Reply With Quote