Raised This Month: $119 Target: $400
 29% 

Calculator.


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Scone
Senior Member
Join Date: Apr 2010
Location: England
Plugin ID:
1884
Plugin Version:
1.1.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    3 
    Plugin Description:
    Calculates maths and stuff.
    Old 08-15-2010 , 09:15   Calculator.
    Reply With Quote #1

    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
    Attached Files
    File Type: sp Get Plugin or Get Source (calc.sp - 1238 views - 13.5 KB)
    __________________

    Last edited by Scone; 08-16-2010 at 14:56.
    Scone is offline
    Scone
    Senior Member
    Join Date: Apr 2010
    Location: England
    Old 08-15-2010 , 15:47   Re: Calculator.
    Reply With Quote #2

    Updated to v1.1.0:
    - Now supports functions as well as operators. See huge list in main post
    __________________
    Scone is offline
    Searcher64
    Senior Member
    Join Date: Apr 2010
    Old 08-15-2010 , 21:55   Re: Calculator.
    Reply With Quote #3

    lol doing math homework at the same time while playing CS:S
    Searcher64 is offline
    DarkEnergy
    SourceMod Donor
    Join Date: Apr 2008
    Location: Georgia Tech, MSECE
    Old 08-15-2010 , 23:51   Re: Calculator.
    Reply With Quote #4

    if only there was eval(...)
    __________________
    War3:Source Developer
    "Your CPU is just a bunch of Muxes"
    DarkEnergy is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 08-16-2010 , 15:27   Re: Calculator.
    Reply With Quote #5

    Impressive
    __________________
    Greyscale is offline
    Scone
    Senior Member
    Join Date: Apr 2010
    Location: England
    Old 08-16-2010 , 15:41   Re: Calculator.
    Reply With Quote #6

    Thanks, it took a good few hours to put together.
    __________________
    Scone is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 09-25-2010 , 04:15   Re: Calculator.
    Reply With Quote #7

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

    Awesome Plugin!
    KyleS is offline
    necavi
    Veteran Member
    Join Date: Sep 2010
    Old 11-03-2011 , 05:29   Re: Calculator.
    Reply With Quote #8

    Exactly what I needed, thank you so much <3
    necavi is offline
    Crasher_3637
    AlliedModders Donor
    Join Date: May 2012
    Location: average villain lair
    Old 01-10-2018 , 22:01   Re: Calculator.
    Reply With Quote #9

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

    Thanks for making this!
    __________________
    AFK like JFK
    Crasher_3637 is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 04:34.


    Powered by vBulletin®
    Copyright ©2000 - 2019, vBulletin Solutions, Inc.
    Theme made by Freecode