Click here to Skip to main content
15,909,437 members
Home / Discussions / C#
   

C#

 
JokeRe: Base 2 Log Method Pin
PIEBALDconsult29-Nov-07 13:06
mvePIEBALDconsult29-Nov-07 13:06 
GeneralRe: Base 2 Log Method Pin
Luc Pattyn29-Nov-07 13:23
sitebuilderLuc Pattyn29-Nov-07 13:23 
GeneralRe: Base 2 Log Method Pin
PIEBALDconsult29-Nov-07 13:43
mvePIEBALDconsult29-Nov-07 13:43 
GeneralRe: Base 2 Log Method Pin
Luc Pattyn29-Nov-07 14:02
sitebuilderLuc Pattyn29-Nov-07 14:02 
GeneralRe: Base 2 Log Method Pin
PIEBALDconsult29-Nov-07 10:26
mvePIEBALDconsult29-Nov-07 10:26 
GeneralRe: Base 2 Log Method Pin
Skippums29-Nov-07 10:45
Skippums29-Nov-07 10:45 
GeneralRe: Base 2 Log Method Pin
PIEBALDconsult29-Nov-07 13:03
mvePIEBALDconsult29-Nov-07 13:03 
GeneralRe: Base 2 Log Method Pin
Skippums29-Nov-07 13:21
Skippums29-Nov-07 13:21 
This won't be faster than what I have already implemented, which is directly related. It is identical in logic to the idea proposed by Luc in a previous post. This is the fastest way to do it in C# without importing external unmanaged code (I am pretty certain), but Luc's way will be slightly faster. This is because this new method will, for most values, perform an additional addition operation. For the only remaining value (0), this method will perform worse by 3 unnecessary test cases and one unnecessary initialization (of the variable result). Therefore, there exists NO condition where this code will take fewer operations than Luc's code, so I don't have to test it. However, it will still be very fast, and would improve your previous algorithm's time to within (I'm guessing) ~80 ms of Luc's. The additional time would be spent on pushing and poping data to the runtime stack in calling the various methods.

Jeff
GeneralRe: Base 2 Log Method [modified] Pin
PIEBALDconsult29-Nov-07 14:15
mvePIEBALDconsult29-Nov-07 14:15 
GeneralRe: Base 2 Log Method Pin
Skippums30-Nov-07 5:19
Skippums30-Nov-07 5:19 
GeneralRe: Base 2 Log Method Pin
PIEBALDconsult30-Nov-07 10:25
mvePIEBALDconsult30-Nov-07 10:25 
GeneralRe: Base 2 Log Method Pin
PIEBALDconsult3-Dec-07 11:07
mvePIEBALDconsult3-Dec-07 11:07 
GeneralRe: Base 2 Log Method Pin
Luc Pattyn29-Nov-07 13:39
sitebuilderLuc Pattyn29-Nov-07 13:39 
GeneralRe: Base 2 Log Method Pin
PIEBALDconsult29-Nov-07 13:48
mvePIEBALDconsult29-Nov-07 13:48 
GeneralRe: Base 2 Log Method Pin
Luc Pattyn29-Nov-07 14:13
sitebuilderLuc Pattyn29-Nov-07 14:13 
GeneralRe: Base 2 Log Method Pin
Luc Pattyn29-Nov-07 10:55
sitebuilderLuc Pattyn29-Nov-07 10:55 
GeneralRe: Base 2 Log Method Pin
PIEBALDconsult29-Nov-07 12:38
mvePIEBALDconsult29-Nov-07 12:38 
GeneralRe: Base 2 Log Method Pin
Luc Pattyn29-Nov-07 13:57
sitebuilderLuc Pattyn29-Nov-07 13:57 
GeneralRe: Base 2 Log Method Pin
PIEBALDconsult29-Nov-07 13:59
mvePIEBALDconsult29-Nov-07 13:59 
AnswerRe: Base 2 Log Method Pin
PIEBALDconsult29-Nov-07 6:02
mvePIEBALDconsult29-Nov-07 6:02 
GeneralRe: Base 2 Log Method Pin
Skippums29-Nov-07 6:22
Skippums29-Nov-07 6:22 
AnswerRe: Base 2 Log Method Pin
Luc Pattyn29-Nov-07 6:15
sitebuilderLuc Pattyn29-Nov-07 6:15 
GeneralRe: Base 2 Log Method Pin
Skippums29-Nov-07 6:30
Skippums29-Nov-07 6:30 
GeneralRe: Base 2 Log Method Pin
Ennis Ray Lynch, Jr.29-Nov-07 6:36
Ennis Ray Lynch, Jr.29-Nov-07 6:36 
GeneralRe: Base 2 Log Method Pin
PIEBALDconsult29-Nov-07 8:58
mvePIEBALDconsult29-Nov-07 8:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.