r/shittyprogramming • • Jun 28 '15

Embedded developer adventures

Post image
297 Upvotes

55 comments sorted by

View all comments

Show parent comments

9

u/immibis Jun 28 '15

You mean like this?

int getRightPartOfDecimal(double d) {
    // XXX 2015-06-28 H.K. - /u/amphetamachine suggested this method to extract the second part of a double
    // XXX 2015-06-28 H.K. - Not sure why this needs an int cast in between though
    return atof((char*)(int)d);
}

2

u/ThisIsADogHello Jun 29 '15
     // XXX 2015-06-28 H.K. - /u/amphetamachine suggested this meth
od to extract the second part of a double

Interesting place for a line break to appear...

2

u/immibis Jun 29 '15

What browser breaks lines in the middle of words?

1

u/ThisIsADogHello Jun 29 '15

Apparently Chrome will, if it's in a <code> tag. I'd rather have that than having to sidescroll, though.

1

u/amphetamachine Jun 29 '15

Chrome could at least let us set sbr.