Options
All
• Public
• Public/Protected
• All

# Class I80F48

• I80F48

## Properties

data: BN

### Static FRACTIONS

FRACTIONS: number = 48

MAX_BN: BN = ...

### Static MAX_SIZE

MAX_SIZE: number = 128

This is represented by a 128 bit signed integer underneath The first 80 bits are treated as an integer and last 48 bits are treated as fractional part after binary point It's possible to think of an I80F48 as an i128 divided by 2 ^ 40

Read up on how fixed point math works: https://inst.eecs.berkeley.edu/~cs61c/sp06/handout/fixedpt.html Read up on how 2s complement works: https://en.wikipedia.org/wiki/Two%27s_complement

MIN_BN: BN = ...

### Static MULTIPLIER_BIG

MULTIPLIER_BIG: Big = ...

### Static MULTIPLIER_BN

MULTIPLIER_BN: BN = ...

### Static MULTIPLIER_NUMBER

MULTIPLIER_NUMBER: number = ...

## Methods

### getBinaryLayout

• getBinaryLayout(): string

### getData

• getData(): BN

### isNeg

• isNeg(): boolean

### isPos

• isPos(): boolean

### isZero

• isZero(): boolean

### mul

• Multiply the two and shift

### toArray

• toArray(): Uint8Array

### toArrayLike

• toArrayLike(ArrayType: typeof Buffer, endian?: Endianness, length?: number): Buffer

• toBig(): Big

### toFixed

• toFixed(decimals?: number): string
• The number will be rounded first for UI sensibilities, then toFixed

### toFormat

• toFormat(decimals: number): string

### toLocaleString

• toLocaleString(locales?: string | string[], options?: NumberFormatOptions): string

### toNumber

• toNumber(): number

### toString

• toString(): string

• toTwos(): BN

### Static fromArray

• fromArray(src: Uint8Array): I80F48

### Static fromNumberOrUndef

• fromNumberOrUndef(x?: number): undefined | I80F48

### Static fromOptionalString

• fromOptionalString(x?: string): undefined | I80F48

### Static fromU64

#### Returns I80F48

Generated using TypeDoc