1
0
Fork 0
forked from fun/fun

More math opcode Fun. (0.37.43)

This commit is contained in:
Johannes Findeisen 2026-01-03 03:35:16 +01:00
commit c062b685e1
18 changed files with 501 additions and 2 deletions

View file

@ -242,7 +242,16 @@ typedef enum {
OP_FLOOR, // pops x (int/float); pushes floor(x) (int if integral else float)
OP_CEIL, // pops x (int/float); pushes ceil(x) (int if integral else float)
OP_TRUNC, // pops x (int/float); pushes trunc(x) (int if integral else float)
OP_ROUND // pops x (int/float); pushes round(x) (half away from zero)
OP_ROUND, // pops x (int/float); pushes round(x) (half away from zero)
// C99 math.h transcendentals (float-aware)
OP_SIN, // pops x (int/float); pushes sin(x)
OP_COS, // pops x (int/float); pushes cos(x)
OP_TAN, // pops x (int/float); pushes tan(x)
OP_EXP, // pops x (int/float); pushes exp(x)
OP_LOG, // pops x (int/float); pushes natural log ln(x)
OP_LOG10, // pops x (int/float); pushes log10(x)
OP_SQRT // pops x (int/float); pushes sqrt(x)
} OpCode;
typedef struct {