Darwinbots Forum
Bots and Simulations => DNA - General => Tips and Tricks => Topic started by: Gobo on November 27, 2007, 04:31:16 AM
-
One may say
sgn sqr
instead of generally adopted
0 floor sgn
Ironically, there is a comment inside DB source code:
'Returns square root of a positive number. Can't think of a specific use but it is valid.
It seems, a specific use is finally found
-
I wonder which of those is more efficient framerate-wise. Considering you're only ever sqrting -1, 0, or 1, if there are special cases in the code for 0, 1, and negative numbers, it shouldn't have the overhead of actually doing a sqrt. Hmm.
-
When I profiled the program years ago, other than vision and physics, the big CPU hog was just the overhead of switching from one base pair to the next. The actual operations the base pairs perform are probably inconsequential by comparison.
-
does sqrt only work if you use 10+? sqrt of 1 is a floating decimal.
-
does sqrt only work if you use 10+? sqrt of 1 is a floating decimal.
What are you smoking? 1*1 = 1.
-
The sqr operator takes the square root of a number, then floors it.
That is, 99 sqr would give you 9.
Negative numbers return 0.
-
does sqrt only work if you use 10+? sqrt of 1 is a floating decimal.
What are you smoking? 1*1 = 1.
lol oh yeah