core/integer-1.0.0

Arbitrary precision integer value.

Description

Represents an arbitrarily large integer value.

Outline

Schema Definitions

This type is an object with the following properties:

  • words

    ndarray-1.0.0Required

    An array of unsigned 32-bit words representing the integer value, stored as little endian (i.e. the first word of the array represents the least significant bits of the integer value).

  • sign

    stringRequired

    String indicating whether the integer value is positive or negative.

    No length restriction

    Must match the following pattern:

    ^[+-]$
    
  • string

    string

    Optional string representation of the integer value. This field is only intended to improve readability for humans, and therefore no assumptions about format should be made by ASDF readers.

    No length restriction

Examples

An integer value that is stored using an internal array:

!core/integer-1.0.0
  sign: +
  string: '1193942770599561143856918438330'
  words: !core/ndarray-1.0.0
    source: 0
    datatype: uint32
    byteorder: little
    shape: [4]

The same integer value is stored using an inline array:

!core/integer-1.0.0
  sign: +
  string: '1193942770599561143856918438330'
  words: !core/ndarray-1.0.0
    data: [1103110586, 1590521629, 299257845, 15]
    datatype: uint32
    shape: [4]

Original Schema

%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/asdf/core/integer-1.0.0"
title: Arbitrary precision integer value.
description: |
  Represents an arbitrarily large integer value.

examples:
  -
    - An integer value that is stored using an internal array
    - |
        !core/integer-1.0.0
          sign: +
          string: '1193942770599561143856918438330'
          words: !core/ndarray-1.0.0
            source: 0
            datatype: uint32
            byteorder: little
            shape: [4]

  -
    - The same integer value is stored using an inline array
    - |
        !core/integer-1.0.0
          sign: +
          string: '1193942770599561143856918438330'
          words: !core/ndarray-1.0.0
            data: [1103110586, 1590521629, 299257845, 15]
            datatype: uint32
            shape: [4]

type: object
properties:
  words:
    $ref: "ndarray-1.0.0"
    description: |
      An array of unsigned 32-bit words representing the integer value, stored
      as little endian (i.e. the first word of the array represents the least
      significant bits of the integer value).
  sign:
    type: string
    pattern: "^[+-]$"
    description: |
      String indicating whether the integer value is positive or negative.
  string:
    type: string
    description: |
      Optional string representation of the integer value. This field is only
      intended to improve readability for humans, and therefore no assumptions
      about format should be made by ASDF readers.
required: [words, sign]
...