FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

My two cents

 
Post new topic   Reply to topic     Forum Index -> Blaze
View previous topic :: View next topic  
Author Message
zzzzrrr



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Fri Mar 13, 2009 9:18 pm    Post subject: My two cents Reply with quote

People, when you're working with computationally intensive code, I would STRONGLY suggest you statically initialize all of your floats to zero. In particular, you probably want remember to do this when porting code from other languages to D.

Today, one particular bug drove me nuts for many, many hours.... Unexpected NaN values were crashing Blaze, and it all basically came down to a single uninitialized float. Keep it simple (KISS), and initialize to zero at declaration. It's too easy to forget or overlook something when dealing with thousands of lines of complex code...

Another rookie mistake, probably yes, but be rest assured that I will not make this error again.... Ah, you have to love statically typed languages!
Back to top
View user's profile Send private message
OlaA



Joined: 10 May 2008
Posts: 2

PostPosted: Thu Mar 19, 2009 11:44 am    Post subject: Reply with quote

I like to NaN check all my floats in invariant blocks (just assert(myFloat == myFloat)) - this has saved me at least some hours of debugging Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Blaze All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group