News

My campaign to produce Shakespeare's Sonnets: A Graphic Novel Adaptation needs your help! Please sign up at https://www.patreon.com/fisherking for access to exclusive content and the opportunity to be a part of the magic!

I'm also producing a podcast discussing the sonnets, available on
industrial curiosity, itunes, spotify, stitcher, tunein and youtube!
For those who prefer reading to listening, the first 25 sonnets have been compiled into a book that is available now on Amazon and the Google Play store.

Friday, September 08, 2006

duuuh... i come with great message



i've finally figured out how to round my numbers down. there's a nifty function in mysql called round(), and round() can round to a specified number of decimal places.

but - wait. the numbers aren't always right. there's a known bug in the round() function, so the mysql reference manual advises using truncate() and floor() instead. okay. i'll bite.

so i add 1/2, floor it, truncate it... and i still get an incorrect round result. the exact same result the round() function gave me. i've been scratching my head over this one enough already, so i start playing with the numbers.

i'm obviously doing something wrong here, right?

...

well, i've discovered the problem. here's my conversation with nystire:

totalwaste says:
so what i have to do is truncate(floor(x+.5))
although that's only in theory
to get it to return the CORRECT values
i need to use x + .55
why the extra .05, you may ask?
go on, ask


...

nystire says:
ok, i'll bite. why?

totalwaste says:
BECAUSE THE ENTIRE FUCKING MATH PACKAGE IS FLAWED, AND IT CAN'T BLOODY WELL *ADD* OR *SUBTRACT* CORRECTLY!


sodding *@$!!#$s.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.