Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Some D-Link storage bays behave in an extremely odd way with (NTFS) timestamps.

Here is a quick sample from some experiments I did:

08:00:01.562 rounds to 08:00:01.000
08:00:01.633 rounds to 08:00:02.000
08:00:02.556 rounds to 08:00:03.000

I'm really puzzled by how 01.562 rounds down while 01.633 rounds up...

Can you understand what's going on here?

PS: Here's an extra table, if it helps.

Input           Output          Nearest second  FAT rounding
08:00:00.000    08:00:00.000    08:00:00.000    08:00:00.000
08:00:00.071    08:00:00.000    08:00:00.000    08:00:02.000
08:00:00.142    08:00:00.000    08:00:00.000    08:00:02.000
08:00:00.213    08:00:00.000    08:00:00.000    08:00:02.000
08:00:00.284    08:00:00.000    08:00:00.000    08:00:02.000
08:00:00.355    08:00:00.000    08:00:00.000    08:00:02.000
08:00:00.426    08:00:00.000    08:00:00.000    08:00:02.000
08:00:00.497    08:00:00.000    08:00:00.000    08:00:02.000
08:00:00.568    08:00:01.000    08:00:01.000    08:00:02.000
08:00:00.639    08:00:01.000    08:00:01.000    08:00:02.000
08:00:00.710    08:00:01.000    08:00:01.000    08:00:02.000
08:00:00.781    08:00:01.000    08:00:01.000    08:00:02.000
08:00:00.852    08:00:01.000    08:00:01.000    08:00:02.000
08:00:00.923    08:00:01.000    08:00:01.000    08:00:02.000
08:00:00.994    08:00:01.000    08:00:01.000    08:00:02.000
08:00:01.065    08:00:01.000    08:00:01.000    08:00:02.000
08:00:01.136    08:00:01.000    08:00:01.000    08:00:02.000
08:00:01.207    08:00:01.000    08:00:01.000    08:00:02.000
08:00:01.278    08:00:01.000    08:00:01.000    08:00:02.000
08:00:01.349    08:00:01.000    08:00:01.000    08:00:02.000
08:00:01.420    08:00:01.000    08:00:01.000    08:00:02.000
08:00:01.491    08:00:01.000    08:00:01.000    08:00:02.000
08:00:01.562    08:00:01.000    08:00:02.000    08:00:02.000
08:00:01.633    08:00:02.000    08:00:02.000    08:00:02.000
08:00:01.704    08:00:02.000    08:00:02.000    08:00:02.000
08:00:01.775    08:00:02.000    08:00:02.000    08:00:02.000
08:00:01.846    08:00:02.000    08:00:02.000    08:00:02.000
08:00:01.917    08:00:02.000    08:00:02.000    08:00:02.000
08:00:01.988    08:00:02.000    08:00:02.000    08:00:02.000
08:00:02.059    08:00:02.000    08:00:02.000    08:00:04.000
08:00:02.130    08:00:02.000    08:00:02.000    08:00:04.000
08:00:02.201    08:00:02.000    08:00:02.000    08:00:04.000
08:00:02.272    08:00:02.000    08:00:02.000    08:00:04.000
08:00:02.343    08:00:02.000    08:00:02.000    08:00:04.000
08:00:02.414    08:00:02.000    08:00:02.000    08:00:04.000
08:00:02.485    08:00:02.000    08:00:02.000    08:00:04.000
08:00:02.556    08:00:03.000    08:00:03.000    08:00:04.000
08:00:02.627    08:00:03.000    08:00:03.000    08:00:04.000
08:00:02.698    08:00:03.000    08:00:03.000    08:00:04.000
08:00:02.769    08:00:03.000    08:00:03.000    08:00:04.000
share|improve this question

migrated from stackoverflow.com May 27 '11 at 20:22

This question came from our site for professional and enthusiast programmers.

1  
Floating-point imprecision, perhaps? –  JAB May 27 '11 at 18:45

2 Answers 2

It may be just looking at the .5 and doing even/odd rounding. This helps keep things a bit sane for addition.

Lets say you have 1.5 and 2.5. If you add them directly, you get 1.5 + 2.5 => 4.0. But... if you round with normal ">= .5 goes up" then you'll get 2.0 + 3.0, and you get 5.0.

Lets change the rule a bit. If you're rounding n.m to integer, you can have a rule for .5 that includes n. For n.5, if n is even, you round up like normal. If n is odd, you round down. So for 1.5, you round down to 1. For 2.5, you round up (like normal) to 3. 1.0 + 3.0 = 4.0, like you'd expect.

share|improve this answer
    
That doesn't match the pattern used, though, since 1.562 rounds to 1 the D-link case. –  Clément May 30 '11 at 21:50
up vote 0 down vote accepted

This seems to be a bug, fixed in latest DLink NAS enclosures.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.