The New Year

  • Comments posted to this topic are about the item The New Year

  • Easy for an old guy who for years had to wade through several IBM mainframe core dumps every day. Thanks, Steve, and Happy New Year!

    All, may the best that happened to you in 2017 be the worst that will happen to you in 2018.

  • Happy New Year and thanks Steve.

    ...

  • Without calculating:
    - 7E1 is odd, 7E2 is even, so it has to be 7E2
    - 2018 is fairly close to 2048, a power of 2, so there's a few 1's at the beginning.

    Nitpick: the binary number has 11 digits, not 12.

  • ildjarn.is.dead - Monday, January 1, 2018 2:36 AM

    Without calculating:
    - 7E1 is odd, 7E2 is even, so it has to be 7E2
    - 2018 is fairly close to 2048, a power of 2, so there's a few 1's at the beginning.

    Nitpick: the binary number has 11 digits, not 12.

    As an 11 bit binary integer it represents -30 and this year isn't 30 BC.  A year number is clearly an integer, an it's a whole number and it can be negative.  To make it represent 2018 you have to see it as a 12 (or more) bit integer.

    Tom

  • Revenant - Saturday, December 30, 2017 3:17 PM

    Easy for an old guy who for years had to wade through several IBM mainframe core dumps every day. Thanks, Steve, and Happy New Year!

    All, may the best that happened to you in 2017 be the worst that will happen to you in 2018.

    Just as easy for someone who had to wade through ICL mainframe core-dumps (and before that ICL 7900 -series telecomunications processor dumps).
    But I wonder how many people tried to find a sinple way to conver a string of 0s and 1s to an integer in T-SQL.  I though about it briefly, but didn't try anything as the only way I could think of was convert to hex by hand and then convert hex to int - I dont think there is any simpler method.

    Similar best wishes to you and to everyone.

    Tom

  • HAPPY NEW YEAR!!!!!!!!!!!!!!!!!!!!!!!

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Nice one, thanks Steve
    Have a fantastic year

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • TomThomson - Monday, January 1, 2018 12:08 PM

    ildjarn.is.dead - Monday, January 1, 2018 2:36 AM

    Without calculating:
    - 7E1 is odd, 7E2 is even, so it has to be 7E2
    - 2018 is fairly close to 2048, a power of 2, so there's a few 1's at the beginning.

    Nitpick: the binary number has 11 digits, not 12.

    As an 11 bit binary integer it represents -30 and this year isn't 30 BC.  A year number is clearly an integer, an it's a whole number and it can be negative.  To make it represent 2018 you have to see it as a 12 (or more) bit integer.

    From the explanation: "In base 2, we need 11111100010. This is a 12 digit numbers [sic].". No, it's an 11 digit number (which should be read as an unsigned binary number). 011111100010 would be a 12 digit number where signedness doesn't matter.

  • Didn't spend a lot of time thinking about, just took a guess and was right.

  • I just looked at the possible answers - binary values first.  As both ended with the binary representation of 2, I picked #7E2, then after looking at the binary patterns I picked the one that had E as the second digit, rather than F.  So instead of working them out properly, I just looked for the equivalent Hex value and Binary pattern!

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply