Cheddar Documentation
  • Introduction
  • Syntax
  • Literals
    • Comment
    • String
    • Number
    • Array
    • Boolean
  • Mathematics
    • Addition
    • Subtraction
    • Multiplication
    • Division
    • Exponentiation
    • Remainder
    • Negation
    • Sign
    • Root
    • Bitwise AND
    • Bitwise OR
    • Bitwise XOR
    • Bitwise NOT
    • Bitwise Left Shift
    • Bitwise Right Shift
  • Variables
  • Functions
    • Defining
      • Lambda
      • Functionized Operators
      • Functionized Properties
    • Operations
      • Functional Bonding
      • Functional Composition
  • Default Operators
    • What Is
    • Instance-of
    • Actually Is
  • Control Flow
    • Conditional
    • Loops
      • For Loops
      • While Loops
  • Standard Library
    • String
      • Bytes
      • Count
      • Length
      • Match
      • Slice
      • Tail
      • Chars
      • Head
      • Lines
      • Ord
      • Split
      • Test
      • Chunk
      • Index
      • Lower
      • Reverse
      • Substitute
      • Upper
  • Developing
    • Structure
    • Primitive Objects
      • Scope
      • Class
      • Variable
      • Namespace
    • Getting Started
    • API
      • Primitives
        • string
        • number
        • array
        • bool
        • func
        • nil
Powered by GitBook
On this page
  • Arguments
  • Usage:

Was this helpful?

  1. Developing
  2. API
  3. Primitives

number

The number class for Cheddar

Arguments

name

type

description

base

number

base to translate the given to

shift

number

number of zeros to append to the value before base change

value

number or string

The literal value of the number

Usage:

0b101, with api:

cheddar.init(
    cheddar.number,
    2, 0, 101
)

0xFF, with api:

cheddar.init(
    cheddar.number,
    16, 0, 'FF'
)

123, with api:

cheddar.init(
    cheddar.number,
    10, 0, 123
)
PreviousstringNextarray

Last updated 4 years ago

Was this helpful?