| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #include "math.h"
- #ifdef IRON_WASM
- __attribute__((import_module("imports"), import_name("js_pow"))) float js_pow(float base, float exponent);
- __attribute__((import_module("imports"), import_name("js_floor"))) float js_floor(float x);
- __attribute__((import_module("imports"), import_name("js_sin"))) float js_sin(float x);
- __attribute__((import_module("imports"), import_name("js_cos"))) float js_cos(float x);
- __attribute__((import_module("imports"), import_name("js_tan"))) float js_tan(float x);
- __attribute__((import_module("imports"), import_name("js_log"))) float js_log(float x);
- __attribute__((import_module("imports"), import_name("js_exp"))) float js_exp(float x);
- __attribute__((import_module("imports"), import_name("js_sqrt"))) float js_sqrt(float x);
- #endif
- double ldexp(double x, int exp) {
- return 0.0;
- }
- double pow(double base, double exponent) {
- #ifdef IRON_WASM
- return js_pow(base, exponent);
- #endif
- return 0.0;
- }
- double floor(double x) {
- #ifdef IRON_WASM
- return js_floor(x);
- #endif
- return 0.0;
- }
- float floorf(float x) {
- #ifdef IRON_WASM
- return js_floor(x);
- #endif
- return 0.0f;
- }
- double sin(double x) {
- #ifdef IRON_WASM
- return js_sin(x);
- #endif
- return 0.0;
- }
- float sinf(float x) {
- #ifdef IRON_WASM
- return js_sin(x);
- #endif
- return 0.0f;
- }
- double cos(double x) {
- #ifdef IRON_WASM
- return js_cos(x);
- #endif
- return 0.0;
- }
- float cosf(float x) {
- #ifdef IRON_WASM
- return js_cos(x);
- #endif
- return 0.0f;
- }
- double tan(double x) {
- #ifdef IRON_WASM
- return js_tan(x);
- #endif
- return 0.0;
- }
- float tanf(float x) {
- #ifdef IRON_WASM
- return js_tan(x);
- #endif
- return 0.0f;
- }
- double log(double x) {
- #ifdef IRON_WASM
- return js_log(x);
- #endif
- return 0.0;
- }
- double exp(double x) {
- #ifdef IRON_WASM
- return js_exp(x);
- #endif
- return 0.0;
- }
- double sqrt(double x) {
- #ifdef IRON_WASM
- return js_sqrt(x);
- #endif
- return 0.0;
- }
|