Author Topic: Binary  (Read 8079 times)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Binary
« Reply #15 on: October 15, 2005, 04:46:23 PM »
That's funny, I just went and tested it today!

Turns out the little bugger is actually slower than regular square root.  Which blows me away, because this function uses like 3 multiplications and not a whole lot else.

I'm going to go research some more, I'll post back here in a new thread if I find anything interesting.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Binary
« Reply #16 on: October 15, 2005, 05:02:10 PM »
Ahaha, here's what I found out:

most compilers (including VB) use some art of the processor specifically built for square rooting.  Result?  Square rooting using sqr(number) is about as fast as you can get.

even doing 1 / sqr(number) is faster than the other ways available.
Probably isn't true on older machines though.

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Binary
« Reply #17 on: October 15, 2005, 09:02:00 PM »
Quote
I only offer this up for those who may not know ...
or may not have explored it in detail ...

I'll raise my hand for that one. Anything outside of decimal hurts my head.

I probably need to learn at least some binary, with the new operators out there I'm sure this will become important eventually.

The compliment feature ~ already looks like it'll be extremly useful to convert from zero to one (with use of abs) or vice versa, depending on what conditional you need.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Binary
« Reply #18 on: October 16, 2005, 12:53:39 PM »
I have a database that stores numbers in base 64. It uses 0-9 and the entire alphabet in upper and lower case and a few other characters too. That was a bit freaky to program but it cut down the length of ID codes from about 12 digits to 4  :D
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Binary
« Reply #19 on: October 16, 2005, 01:23:48 PM »
well, that help alot, with that you get 16777216 possible combinations
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA