Jump to content

Rounding? Help Please.


Recommended Posts

er... O_O

even i child of 10 can solve this one :(

well 1/3 equals ~0.3333 and that number * 3 = 1

The if statements looks if the result equals 1, and yes it does.

then it shows it in a msgbox.

To make my post a little more useful i will say a more simple way to form the code you have:

$num = (1/3)*3

if $num = 1 then
 msgbox(0, "YAY", $num)
else
 msgbox(0, "", "Fail")
endif

you see that you used too many (1/3)*3blabla, instead you could've written 1x the $num var, and call THAT up.

costed you less typing :)

just the info

immense

Link to comment
Share on other sites

This is actually a very interesting mathematical question. The above is the proof that 0.999999... is equal to 1. Why? Because 1/3 is not 0.333 it's 0.333... (notice the dots) and that times 3 is 0.999... which is equal to 1 ( since 1/3 = 0.333 and 1/3*3 is equal to one).

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

This is actually a very interesting mathematical question. The above is the proof that 0.999999... is equal to 1. Why? Because 1/3 is not 0.333 it's 0.333... (notice the dots) and that times 3 is 0.999... which is equal to 1 ( since 1/3 = 0.333 and 1/3*3 is equal to one).

interesting that you would bring that up, I was actually trying to use this as a sort of "joke" to disprove that :)

@Immense - Thanks for your attempt to help me, but that is not at all relevant sadly. I know how to code this lol, it isn't for anything "practical" simply a demonstration.

Coder's Helper >> Here[center][/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...