AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Calculator. (https://forums.alliedmods.net/showthread.php?t=135354)

Scone 08-15-2010 09:15

Calculator.
 
1 Attachment(s)
Calculator

A relatively advanced calculator, for use in chat or in console. Can parse complex mathematical expressions.

Usage

In chat:
Code:

!calc 1 + 1
/calc 1 + 1

In console:
Code:

sm_calc 1 + 1
Supported operators:
  • a + b
  • a - b
  • a * b
  • a / b
  • a ^ b
  • a % b
  • _a (negative a)

Supported functions:
  • sqrt(n)
  • root(root, n)
  • log(n)
  • ln(n)
  • sin(n)
  • cos(n)
  • tan(n)
  • asin(n)
  • acos(n)
  • atan(n)
  • degtorad(deg)
  • radtodeg(rad)
  • round(n)
  • ceil(n)
  • floor(n)
  • random()
  • abs(n)
  • e()
  • pi()

Examples:

Code:

!calc 1 + 1
[Calc] Result: 2.

Code:

!calc 3 + 2 * 2 + 1
[Calc] Result: 8.

Code:

!calc (3 + 2) * (2 + 1)
[Calc] Result: 15.

Code:

!calc 2 ^ 10
[Calc] Result: 1024.

Code:

!calc 101 % 4
[Calc] Result: 1.

Code:

!calc 103 % 4
[Calc] Result: 3.

Code:

!calc log(10000)
[Calc] Result: 4.

Code:

!calc ln(e())
[Calc] Result: 1.

Code:

!calc sqrt(16)
[Calc] Result: 4.

Code:

!calc root(2, 16)
[Calc] Result: 4.

Code:

!calc 2 * _1
[Calc] Result: -2.

Code:

!calc sin(degtorad(30))
[Calc] Result: 0.5

Code:

!calc 2.098 / 0.142
[Calc] Warning: Result may contain floating point inaccuracies.
[Calc] Result: 14.774647

Code:

!calc round(pi()^(2 - 0.7) + 5*((6/(9 - 2)) + ln(e())))
[Calc] Result: 14.

Pretty self explanatory, really. Enjoy :)

Scone 08-15-2010 15:47

Re: Calculator.
 
Updated to v1.1.0:
- Now supports functions as well as operators. See huge list in main post :)

Searcher64 08-15-2010 21:55

Re: Calculator.
 
lol doing math homework at the same time while playing CS:S

DarkEnergy 08-15-2010 23:51

Re: Calculator.
 
if only there was eval(...)

Greyscale 08-16-2010 15:27

Re: Calculator.
 
Impressive :)

Scone 08-16-2010 15:41

Re: Calculator.
 
Thanks, it took a good few hours to put together.

KyleS 09-25-2010 04:15

Re: Calculator.
 
I was thinking about making this a while back then completely forgot about it.

Awesome Plugin!

necavi 11-03-2011 05:29

Re: Calculator.
 
Exactly what I needed, thank you so much <3

Psyk0tik 01-10-2018 22:01

Re: Calculator.
 
For whatever reason, I find this plugin intriguing. I'm gonna download it just because! :P

Thanks for making this!


All times are GMT -4. The time now is 02:57.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.