samp.directory
← Scripts et bibliothèques

Sreyas-Sreelal/matheval

pawn library for evaluating mathematical expressions

Outil★ 13mis à jour nov. 2018GPL-3.0SourcePawnsampctl
Ouvrir sur GitHub

Installer avec sampctl

sampctl package install Sreyas-Sreelal/matheval

Lance ceci dans le dossier de ton projet. sampctl télécharge le paquet et ce dont il dépend.

Dépend de 1 paquet

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

Cette page est construite à partir de ce que GitHub publie sur le dépôt. samp.directory n’héberge pas le code. Signaler un problème avec cette fiche

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