Jump to content




Advanced Calculator


  • This topic is locked This topic is locked
54 replies to this topic

#1 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 21 December 2012 - 09:02 AM

After much trial and error, and some useful help from the Ask A Pro section, I have finally finished my Advanced Calculator.
It utilizes almost every function within the Lua math library, and can calculate quite accurately.

Features:
  • Easy to use GUI, with mouse support and number pad support.
  • Large print display.
  • Error handling - Almost completely idiot proof. You won't be able to break the program that easily.
Screenshots:

Posted Image

Download:

http://pastebin.com/nAinUn1h

Bugs:
  • Cannot calculate infinity. Doing so causes an attempt to get length of nil error. YOu can't get the length of an infinite number. I have fixed this error. You can now calculate infinite numbers, as well as divide by 0.
  • Error is generated in calculating large numbers. When multiplying huge numbers, I cannot get the length of a non-terminating decimal number.
Let me know of any bugs you find, as I want this to become the number one calculator through ComputerCraft.

Edited by Cranium, 28 December 2012 - 05:23 AM.


#2 NDFJay

  • Members
  • 216 posts
  • LocationLeeds, England

Posted 21 December 2012 - 09:06 AM

Not going to lie, that is pretty damn sexy! but it cant divide by zero... :P

#3 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 21 December 2012 - 09:18 AM

View PostNDFJay, on 21 December 2012 - 09:06 AM, said:

Not going to lie, that is pretty damn sexy! but it cant divide by zero... :P
Wow.... You instantly tried to divide by zero, and broke my calculator... You have mastered the art of destruction.

#4 NDFJay

  • Members
  • 216 posts
  • LocationLeeds, England

Posted 21 December 2012 - 09:25 AM

View PostCranium, on 21 December 2012 - 09:18 AM, said:

View PostNDFJay, on 21 December 2012 - 09:06 AM, said:

Not going to lie, that is pretty damn sexy! but it cant divide by zero... :P
Wow.... You instantly tried to divide by zero, and broke my calculator... You have mastered the art of destruction.
what can I say, I'm on a mission to destroy the world as we know it through the course of division by zero :P that and pi ^_^

#5 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 21 December 2012 - 09:31 AM

View PostNDFJay, on 21 December 2012 - 09:25 AM, said:

what can I say, I'm on a mission to destroy the world as we know it through the course of division by zero :P that and pi ^_^
Well, I can confidently say that Pi does calculate on this program.

#6 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 21 December 2012 - 09:33 AM

Multiply 9999999999 by 9999999, broke it

Press random buttons, broke it (Well, every thing turned red)

Make a really long operation, it gets of screen

#7 NDFJay

  • Members
  • 216 posts
  • LocationLeeds, England

Posted 21 December 2012 - 09:34 AM

yes it does ^_^ even if by is an infinite variable :P

#8 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 21 December 2012 - 09:37 AM

I love it. :)

#9 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 21 December 2012 - 09:37 AM

-_-
You guys are just finding ways to calculate infinity......
Lua hates infinity.

#10 NDFJay

  • Members
  • 216 posts
  • LocationLeeds, England

Posted 21 December 2012 - 09:40 AM

Lua shouldnt be so finite then :P

#11 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 21 December 2012 - 10:38 AM

I have fixed the divide by zero error.

#12 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 21 December 2012 - 10:44 AM

needs
tan
atan
atan2
acos
asin
an ON button
easter eggs
:3

#13 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 21 December 2012 - 10:44 AM

View PostCranium, on 21 December 2012 - 10:38 AM, said:

I have fixed the divide by zero error.
Still, error with LARGE numbers

Posted Image

#14 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 21 December 2012 - 10:56 AM

View PostPixelToast, on 21 December 2012 - 10:44 AM, said:

needs
tan
atan
atan2
acos
asin
an ON button
easter eggs
:3
It does have tan, atan, acos, and asin. I could not figure a way to add atan2 though. It would return the same thing, so I did not need to add it.

View Postanonimo182, on 21 December 2012 - 10:44 AM, said:

Still, error with LARGE numbers
I did note that huge numbers cannot be calculated. It is an error trying to get the length of a non-terminating decimal.

#15 AndreWalia

  • Members
  • 294 posts
  • LocationSt.Louis, MO

Posted 21 December 2012 - 11:02 AM

Very cool! I have made something somewhat like this. Was planning to release it, but you are too much competition :(

#16 Zaggy1024

  • Members
  • 23 posts

Posted 21 December 2012 - 03:07 PM

Shouldn't the non-zero numbers be reversed vertically? That's what I'd expect a calculator to be like normally...

#17 rhyleymaster

  • Members
  • 186 posts
  • LocationCanada

Posted 21 December 2012 - 09:27 PM

I use this in science class now.

#18 rhyleymaster

  • Members
  • 186 posts
  • LocationCanada

Posted 21 December 2012 - 09:32 PM

also, change your pi to : http://pastebin.com/nax2n6sZ
put into pastebin cause its 100,000 digits kindly generated by my computer. (took a long time. I realized i could just google it...)

#19 rhyleymaster

  • Members
  • 186 posts
  • LocationCanada

Posted 21 December 2012 - 09:34 PM

Also, dividing by zero dosen't give you 0. It gives you 0 repeating because you cannot divide something by nothing. (indefinite is what you gets)

#20 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 21 December 2012 - 09:42 PM

View Postrhyleymaster, on 21 December 2012 - 09:34 PM, said:

Also, dividing by zero dosen't give you 0. It gives you 0 repeating because you cannot divide something by nothing. (indefinite is what you gets)
Who said it did give zero? Also, indefinite (or nan - not a number - in Lua) is what you should get, but inf is what you get in Lua [Limit(1/0)].





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users