1. Introduction
  2. Install
  3. 1. The Snax Language
    1. 1.1. Numbers
    2. 1.2. Strings
    3. 1.3. Compiler Functions
  4. 2. Standard Library
    1. 2.1. math
    2. 2.2. string
    3. 2.3. memory
    4. 2.4. io
  5. 3. The Snax Compiler
    1. 3.1. Parsing
    2. 3.2. Compiling

Snax

    The snax/math.snx module

    Since snax doesn't currently support generics, all math functions come in a number of variants for the different numerical types. For example, to calculate the sin(x), you must choose between the 32 and 64 bit float variants: sinf32(x) and sinf64(x), depending on the type of x.

    Floating Point Functions

    Trigonometric Functions

    Snax currently supports sin and cos functions for 32 and 64 bit floats.

    These functions are implemented using Bhaskara I's approximation and will differ slightly from the output of trigonometric functions from other languages.