Click here to Skip to main content
15,913,055 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralActually, it was Archimedes Pin
Jay Gatsby17-Aug-07 11:51
Jay Gatsby17-Aug-07 11:51 
JokeRe: The origins of calculus Pin
PIEBALDconsult26-Aug-07 5:45
mvePIEBALDconsult26-Aug-07 5:45 
QuestionGetting s week number from a date Pin
Steven J Jowett6-Aug-07 6:14
Steven J Jowett6-Aug-07 6:14 
AnswerRe: Getting s week number from a date Pin
cp98766-Aug-07 15:10
cp98766-Aug-07 15:10 
GeneralRe: Getting s week number from a date Pin
Steven J Jowett6-Aug-07 22:19
Steven J Jowett6-Aug-07 22:19 
QuestionBasic 64-bit integer question Pin
Domenic Denicola1-Aug-07 16:42
Domenic Denicola1-Aug-07 16:42 
AnswerRe: Basic 64-bit integer question [modified] Pin
Luc Pattyn1-Aug-07 23:14
sitebuilderLuc Pattyn1-Aug-07 23:14 
GeneralRe: Basic 64-bit integer question Pin
Domenic Denicola2-Aug-07 6:27
Domenic Denicola2-Aug-07 6:27 
Interestingly, my experiments don't exactly follow your predictions...

long ticks = (new DateTime(2003, 3, 18, 21, 22, 10, DateTimeKind.Local) - new DateTime(1601, 1, 1, 0, 0, 0, DateTimeKind.Utc)).Ticks;

ticks >> 32: 29552020
(ulong)ticks >> 32: 29552020
ticks & 0x00000000FFFFFFFFL: 1869262080
(uint)((ulong)ticks): 1869262080
(uint)ticks: 1869262080


In particular casting to uint seems to give the same result as the bitmask, and not as the shifting, and signed versus unsigned doesn't seem to matter much (probably because all my numbers are positive and not too large?)

Also, strangely enough, the original source for which I'm working on this (see here) seems to want to want to multiply the high part by 2? Any reason why it would do this?

(Backstory: I have a Cookie object in .NET, and I want to write it to the Internet Explorer cookies file. Which has this wierd date format based on the high- and low- parts of a 64-bit ticks integer. But, as you can see above, apparently they multiply the high part by 2 before storing it.)


-Domenic Denicola- [CPUA 0x1337]

“I was born human. But this was an accident of fate—a condition merely of time and place. I believe it's something we have the power to change…”

GeneralRe: Basic 64-bit integer question Pin
Luc Pattyn2-Aug-07 6:47
sitebuilderLuc Pattyn2-Aug-07 6:47 
GeneralHey Luc, Pin
CPallini2-Aug-07 21:18
mveCPallini2-Aug-07 21:18 
GeneralRe: Hey Luc, Pin
Luc Pattyn2-Aug-07 21:43
sitebuilderLuc Pattyn2-Aug-07 21:43 
GeneralSorry... Pin
CPallini2-Aug-07 21:50
mveCPallini2-Aug-07 21:50 
Questionimage Pin
zainab ibrahim29-Jul-07 22:54
zainab ibrahim29-Jul-07 22:54 
AnswerRe: image Pin
Habib Ahmed Bhutto30-Jul-07 12:39
Habib Ahmed Bhutto30-Jul-07 12:39 
QuestionPatterns Pin
ThaScorpion29-Jul-07 14:40
ThaScorpion29-Jul-07 14:40 
AnswerRe: Patterns Pin
cp987629-Jul-07 14:56
cp987629-Jul-07 14:56 
GeneralRe: Patterns Pin
ThaScorpion29-Jul-07 15:08
ThaScorpion29-Jul-07 15:08 
GeneralRe: Patterns Pin
Paul Conrad29-Jul-07 17:00
professionalPaul Conrad29-Jul-07 17:00 
GeneralRe: Patterns Pin
Jörgen Sigvardsson2-Aug-07 21:15
Jörgen Sigvardsson2-Aug-07 21:15 
GeneralRe: Patterns Pin
Paul Conrad3-Aug-07 3:34
professionalPaul Conrad3-Aug-07 3:34 
GeneralRe: Patterns Pin
Jörgen Sigvardsson3-Aug-07 3:41
Jörgen Sigvardsson3-Aug-07 3:41 
GeneralRe: Patterns Pin
Malcolm Smart11-Aug-07 10:19
Malcolm Smart11-Aug-07 10:19 
GeneralRe: Patterns Pin
Paul Conrad11-Aug-07 10:28
professionalPaul Conrad11-Aug-07 10:28 
AnswerRe: Patterns Pin
Stephen Hewitt29-Jul-07 15:41
Stephen Hewitt29-Jul-07 15:41 
GeneralRe: Patterns Pin
Paul Conrad29-Jul-07 17:36
professionalPaul Conrad29-Jul-07 17:36 

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.