December 03, 2020, 07:55:15 PM

Author Topic: [bb] faster bin to int :D by Curtastic [ 1+ years ago ]  (Read 374 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] faster bin to int :D by Curtastic [ 1+ years ago ]
« on: June 29, 2017, 12:28:39 AM »
Title : faster bin to int :D
Author : Curtastic
Posted : 1+ years ago

Description : converts a binary string to an integer

Code :
Code: BlitzBasic
  1. Function bin2int(b$)
  2.     blen=Len(b)
  3.     For f=1 To blen
  4.         n=n Shl 1 + (Mid(b,f,1)="1")
  5.     Next
  6.     Return n
  7. End Function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal