How to use the token-types.Float64_BE function in token-types

To help you get started, we’ve selected a few token-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Borewit / music-metadata / lib / ebml / EbmlParser.ts View on Github external
private async readFloat(e: IHeader) {
    switch (e.len) {
      case 0:
        return 0.0;
      case 4:
        return this.tokenizer.readNumber(Token.Float32_BE);
      case 8:
        return this.tokenizer.readNumber(Token.Float64_BE);
      case 10:
        return this.tokenizer.readNumber(Token.Float64_BE);
      default:
        throw new Error(`Invalid IEEE-754 float length: ${e.len}`);
    }
  }
github Borewit / music-metadata / lib / matroska / MatroskaParser.ts View on Github external
private async readFloat(e: IHeader) {
    switch (e.len) {
      case 0:
        return 0.0;
      case 4:
        return this.tokenizer.readNumber(Token.Float32_BE);
      case 8:
        return this.tokenizer.readNumber(Token.Float64_BE);
      case 10:
        return this.tokenizer.readNumber(Token.Float64_BE);
      default:
        throw new Error(`Invalid IEEE-754 float length: ${e.len}`);
    }
  }