## Recommended Posts

I stumbled across a website the other day that said only one interesting thing... That you round -1.5 to -2. I have always been taught this should in fact be -1, so I asked wikipedia, found out there is actually about 8 different ways to resolve tie breaks. So I did a lot of research into rounding, and made this function.

The functions parameters are a bit too complex to be all listed here, alongsside other stuff I need to mention, so I made a simple web page for it.

On the page is the download link as well as another link to a dialog I created that is pretty simple, but gives you all the options in a more usable way. I might release it as an actual program later, but its not particularly useful. Even If you have no need for either, it makes very interesting reading, and does teach you a lot about computing numbers and floats.

Mat

Edit: you know, I was kinda hoping someone MIGHT just be interested, but I've had 4 vistors to that page, with an interest span of... <10secs. Maybe it wasn't worth the bother.

Edited by Mat
##### Share on other sites

Hey Mat, that was very interesting to read! : ) I never knew there were different types of rounding either, but you explained it very simple.

##### Share on other sites

Thanks manadar, good to see someone read it! Its explained simple becouse I understand it simple. I should probably do this on the page; a list of my sources:

1) Wikipedia

^^ The above was very helpful, and is aimed at programming.

Wikipedia was the first thing I found (obviously!), the other two I found in the reference section there. The PDF is a VERY interesting read, and explains functions such as: Mod, Int, Round, Floor, Ceiling. It also gives other ideas like getting the fractional part etc.

Mat

##### Share on other sites

I'm definitely bookmarking this thread. I have a feeling it will be useful in the future.

##### Share on other sites

Thanks again manadar! This was written as a function for my minicalculator script (just passed 2000 lines), and there it is proving incredibly useful!!!

The other thing I'm thinking of is combining this with some bigint functions... creating myself a kind of "pure maths" udf. Shouldn't be too hard... I could add some other functions i've done like my root function.

Why maths excites me I will never know.

Mat

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
×
• Create New...