samp.directory
← Skripte und Bibliotheken

Sreyas-Sreelal/matheval

pawn library for evaluating mathematical expressions

Tool★ 13aktualisiert Nov. 2018GPL-3.0SourcePawnsampctl
Auf GitHub öffnen

Mit sampctl installieren

sampctl package install Sreyas-Sreelal/matheval

Führe das in deinem Projektordner aus. sampctl lädt das Paket und alles herunter, wovon es abhängt.

Hängt von 1 Paket ab

README.md

matheval

This is a simple library for evaluating mathematical expressions given as string literals.Currently supported operators are:

  • + - addition

  • - - subraction

  • ^ - exponential

  • / - division

  • * - product

Installation

If you are using sampctl just use

sampctl package install Sreyas-Sreelal/matheval

Otherwise just clone the repository

git clone https://www.github.com/sreyas-sreelal/matheval.git

and add matheval.inc to your pawno/includes folder

Usage

There is only one function

MathEval(expression[])

parameters
  • expression[] - mathmatical expression in string literal
returns
  • NaN if failed

  • if success,value in floating point

For example :


#include<matheval>

main(){

printf("(1+3)^(32/3)-1 = %f",MathEval("(1+3)^(32/3)-1"));

}

Testing

To run the tests:

sampctl package run

Dependencies

includepawnpawn-packagesa-mpsampsampctl

Diese Seite wird aus dem erstellt, was GitHub über das Repository veröffentlicht. samp.directory hostet den Code nicht. Ein Problem mit diesem Eintrag melden

Sreyas-Sreelal/matheval: SA-MP Tool | samp.directory