Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
sign.c File Reference

Implements the OP_SIGN opcode returning -1, 0, or 1. More...

Go to the source code of this file.

Functions

 if (v.type==VAL_INT)
 exit (1)
 free_value (v)
 push_value (vm, make_int(out))

Variables

case OP_SIGN
int out = 0
 else
 break

Detailed Description

Implements the OP_SIGN opcode returning -1, 0, or 1.

Definition in file sign.c.

Function Documentation

◆ exit()

exit(1)

◆ free_value()

free_value(v)

◆ if()

if(v.type = VAL_INT)

Definition at line 18 of file sign.c.

◆ push_value()

push_value(vm,
make_int(out) )

Variable Documentation

◆ break

break

Definition at line 33 of file sign.c.

◆ else

else
Initial value:
{
fprintf(stderr, "Runtime type error: SIGN expects number, got %s\n", value_type_name(v.type))
Value v
Definition cast.c:22
#define fprintf
Definition vm.c:200

Definition at line 27 of file sign.c.

◆ OP_SIGN

case OP_SIGN

Definition at line 15 of file sign.c.

◆ out

int out = 0

Definition at line 17 of file sign.c.