Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created April 13, 2020 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/e0321b379aa2394a4e204b2a10235a7e to your computer and use it in GitHub Desktop.
Save parzibyte/e0321b379aa2394a4e204b2a10235a7e to your computer and use it in GitHub Desktop.
/*
____ _____ _ _ _
| _ \ | __ \ (_) | | |
| |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___
| _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \
| |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/
|____/ \__, | |_| \__,_|_| /___|_|_.__/ \__, |\__\___|
__/ | __/ |
|___/ |___/
Blog: https://parzibyte.me/blog
Ayuda: https://parzibyte.me/blog/contrataciones-ayuda/
Contacto: https://parzibyte.me/blog/contacto/
Copyright (c) 2020 Luis Cabrera Benito
Licenciado bajo la licencia MIT
El texto de arriba debe ser incluido en cualquier redistribución
*/
#include <stdio.h>
// Se debe incluir con "" y no con <>, para que busque de manera relativa
#include "tinyexpr.h"
#include "tinyexpr.c"
int main() {
/*
Ahora tenemos a las funciones:
te_interp
te_compile
te_eval
te_free
*/
char *expresion = "2^3 * 5";
double resultado = te_interp(expresion, 0);
printf("%s es: %f", expresion, resultado);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment