# typelevel/spire

Powerful new number types and numeric abstractions for Scala.

Repository: https://github.com/typelevel/spire
Canonical: https://ross.abutalabs.com/products/spire
Homepage: http://typelevel.org/spire/
Language: Scala
License: MIT
License Family: permissive
Last push: 2026-07-27T16:55:37+00:00

## Health v2 (maintenance only)
Score: 65/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 94, release rhythm 8, longevity 100
- inputs: {"age_days": 5417, "days_push": 37, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1772, forks 239 (observed 2026-08-28T04:05:34.225364+00:00)

## What it is
Spire is a numeric library for Scala providing powerful new number types (like Rational, Complex, and more) and generic numeric abstractions via type classes. It aims to be fast and precise, using specialization and macros so generic code performs like hand-written numeric code.

## Use cases
- perform exact arithmetic with rational numbers in Scala
- write generic numeric algorithms without baking in a numeric type
- use complex numbers, intervals, and other number types in Scala
- avoid boxing overhead in generic numeric code
- implement math-heavy libraries with type class abstractions

## When to choose
- you need precise or arbitrary-precision numeric types on the JVM or Scala.js
- you want generic numeric code with performance comparable to direct implementations
- you're in the Typelevel/Scala ecosystem and want algebraic type classes

## When to avoid
- you're not working in Scala
- you only need simple built-in Int/Double arithmetic
- you need GPU or vectorized numeric computing

## Facets
- artifact type: library
- maturity: active
- function: math, serialization
- domain: programming-languages, mathematics
- platform: jvm, jvm-scripting
- tags: numeric-types, typeclasses, scala, specialization, rational-numbers, complex-numbers, algorithms

## Member repositories
- typelevel/spire (main) score 65

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:34.225364+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:25:58.540634+00:00, confidence not recorded.
  - readme: https://github.com/typelevel/spire (fetched 2026-08-28T04:05:34.225364+00:00, sha 58ef3e24d57b)
  - homepage: http://typelevel.org/spire/ (fetched 2026-08-29T11:04:07.992377+00:00, sha 72263392f3f9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
