Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no_std support #22

Merged
merged 1 commit into from
May 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,33 @@ description = "Complex numbers implementation for Rust"
documentation = "https://docs.rs/num-complex"
homepage = "https://github.com/rust-num/num-complex"
keywords = ["mathematics", "numerics"]
categories = [ "algorithms", "data-structures", "science" ]
categories = ["algorithms", "data-structures", "science", "no-std"]
license = "MIT/Apache-2.0"
name = "num-complex"
repository = "https://github.com/rust-num/num-complex"
version = "0.2.0-git"
publish = false
readme = "README.md"

[package.metadata.docs.rs]
all-features = true

[dependencies]

[dependencies.num-traits]
version = "0.2.1"
default-features = false
features = ["std"]

[dependencies.serde]
optional = true
version = "1.0"
default-features = false

[dependencies.rand]
optional = true
version = "0.4"
default-features = false

[features]
default = []
unstable = []
default = ["std"]
std = ["num-traits/std"]
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![crate](https://img.shields.io/crates/v/num-complex.svg)](https://crates.io/crates/num-complex)
[![documentation](https://docs.rs/num-complex/badge.svg)](https://docs.rs/num-complex)
![minimum rustc 1.8](https://img.shields.io/badge/rustc-1.8+-red.svg)
![minimum rustc 1.8](https://img.shields.io/badge/rustc-1.15+-red.svg)
[![Travis status](https://travis-ci.org/rust-num/num-complex.svg?branch=master)](https://travis-ci.org/rust-num/num-complex)

`Complex` numbers for Rust.
Expand All @@ -13,7 +13,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
num-complex = "0.1"
num-complex = "0.2"
```

and this to your crate root:
Expand All @@ -22,10 +22,25 @@ and this to your crate root:
extern crate num_complex;
```

## Features

This crate can be used without the standard library (`#![no_std]`) by disabling
the default `std` feature. Use this in `Cargo.toml`:

```toml
[dependencies.num-complex]
version = "0.2"
default-features = false
```

Features based on `Float` types are only available when `std` is enabled. Where
possible, `FloatCore` is used instead. Formatting complex numbers only supports
format width when `std` is enabled.

## Releases

Release notes are available in [RELEASES.md](RELEASES.md).

## Compatibility

The `num-complex` crate is tested for rustc 1.8 and greater.
The `num-complex` crate is tested for rustc 1.15 and greater.