CraftScript
  • CraftScript
  • Syntax
    • Kinds
    • Keywords
    • Language Features
  • Tutorials
    • Getting Started
      • Assurance Keywords
      • Value Keywords
      • Condition Keywords
      • Other Keywords
    • Using the Language
      • The Do Block
    • Importing External Scripts
    • Adding CraftScript to a Server
    • Environments and Contexts
  • Libraries
    • Reflection
    • Debug
    • Math
    • Parser
    • Global
Powered by GitBook
On this page
  1. Libraries

Math

The built-in maths library.

This library contains mathematical functions implemented in assembly or calculated by the machine for maximum performance.

Function
Use

log

Logarithm

cos

Cosine

atan

Arc tangent

to_degrees

Converts radians to degrees

cbrt

Cube root

tanh

Hyperbolic tangent

min

Minimum of two values

sqrt

Square root

hypot

Hypotenuse given O, A

sin

Sine

pow

X to the power Y

floor

Reduce a number to the previous integer

exp

Exponent

atan2

Arc tangent from coordinates

tan

Tangent

signum

Signum

sinh

Hyperbolic sine

max

Maximum of two values

ceil

Raise a number to the next integer

acos

Arc cosine

cosh

Hyperbolic cosine

to_radians

Converts degrees to radians

abs

Absolute (positive) value of a number

round

Rounds a number to the nearest whole value

asin

Arc sine

PreviousDebugNextParser

Last updated 1 year ago