Coder Social home page Coder Social logo

typed-integers's Introduction

typed-integers

A system used to manage integers with specific memory sizes.

Provided Exports

TypedInteger

This is the base class for Both the Uint and Int classes. It includes basic functionality that includes formatting when toString and Symbol.toStringTag are called.

Instance Properties

readonly TAG: string

The name of the class, used to format Object.toString.

readonly clamp: boolean

Whether or not to clamp the values rather than wrap them.

value: number

This is the numerical value of the instance. Setting this will automatically fix the value within the instance's bounds.

Uint

Extends TypedInteger.

Base class of the Unsigned Integer types.

Instance properties

readonly max: number

The maximum value that the Uint can store.

Static Methods

maxValueFromBits(bits: number): number

Get the maximum value of the variable from the number of bits it will be stored in.

Parameters:

  • bits: number - The size in bits.

Returns: The maximum value of a Uint with the given size.

SubClasses

  • Uint.Uint8 - Uint with 8 bits of storage.
  • Uint.Uint8Clamped - Clamped Uint with 8 bits of storage.
  • Uint.Uint16 - Uint with 16 bits of storage.
  • Uint.Uint16Clamped - Clamped Uint with 16 bits of storage.
  • Uint.Uint32 - Uint with 32 bits of storage.
  • Uint.Uint32Clamped - Clamped Uint with 32 bits of storage.
  • Uint.Uint64 - Uint with 64 bits of storage.
  • Uint.Uint64Clamped - Clamped Uint with 64 bits of storage.

Int

Extends TypedInteger.

Base class of the Signed Integer types.

Instance properties

readonly bounds: [number, number]

The minimum and maximum value that the Int can store.

Static Methods

valueLimitsFromBits(bits: number): number

Get the maximum and minimum value of the variable from the number of bits it will be stored in.

Parameters:

  • bits: number - The size in bits.

Returns: The maximum and minimum values of a Iint with the given size.

SubClasses

  • Int.Int8 - Int with 8 bits of storage.
  • Int.Int8Clamped - Clamped Int with 8 bits of storage.
  • Int.Int16 - Int with 16 bits of storage.
  • Int.Int16Clamped - Clamped Int with 16 bits of storage.
  • Int.Int32 - Int with 32 bits of storage.
  • Int.Int32Clamped - Clamped Int with 32 bits of storage.
  • Int.Int64 - Int with 64 bits of storage.
  • Int.Int64Clamped - Clamped Int with 64 bits of storage.

typed-integers's People

Contributors

nexensys avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.