Purple  0.1
Standard Language Specification
Functions
number.c File Reference

Functions for dealing with numbers internally. More...

#include <math.h>
#include <stdio.h>
#include "scan.h"
#include "types/number.h"
Include dependency graph for number.c:

Functions

NumberType token_type_to_number_type (int token_type)
 Convert a TokenType to a NumberType. More...
 
int number_to_token_type (Number number)
 
NumberType max_numbertype_for_val (long long int value)
 Finds the maximum NumberType possible for a given value. More...
 

Detailed Description

Functions for dealing with numbers internally.

Author
Charles Averill
Date
12-Sep-2022

Function Documentation

◆ max_numbertype_for_val()

NumberType max_numbertype_for_val ( long long int  value)

Finds the maximum NumberType possible for a given value.

Parameters
valueValue to check
Returns
NumberType Corresponding NumberType, or -1 if none was found

◆ number_to_token_type()

int number_to_token_type ( Number  number)

◆ token_type_to_number_type()

NumberType token_type_to_number_type ( int  token_type)

Convert a TokenType to a NumberType.

Parameters
token_typeTokenType to convert
Returns
NumberType Converted TokenType