Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
.github/workflows/ | 12-May-2024 | - | 178 | 163 | ||
ci/ | 12-May-2024 | - | 71 | 46 | ||
src/ | 12-May-2024 | - | 7,524 | 3,795 | ||
tests/ | 12-May-2024 | - | 398 | 332 | ||
.gitignore | D | 12-May-2024 | 18 | 3 | 2 | |
BUILD.gn | D | 12-May-2024 | 1.3 KiB | 45 | 41 | |
Cargo.toml | D | 12-May-2024 | 697 | 29 | 24 | |
LICENSE-APACHE | D | 12-May-2024 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | D | 12-May-2024 | 1 KiB | 26 | 22 | |
README zh.md | D | 12-May-2024 | 2.4 KiB | 73 | 50 | |
README.OpenSource | D | 12-May-2024 | 381 | 11 | 11 | |
README.md | D | 12-May-2024 | 2.1 KiB | 64 | 42 | |
RELEASES.md | D | 12-May-2024 | 10.6 KiB | 260 | 183 | |
bors.toml | D | 12-May-2024 | 204 | 14 | 13 | |
build.rs | D | 12-May-2024 | 949 | 30 | 20 |
README zh.md
1# num-traits 2 3[](https://crates.io/crates/num-traits) 4[](https://docs.rs/num-traits) 5[](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) 6[](https://github.com/rust-num/num-traits/actions) 7 8## 引入背景 9Num-traits在rust中提供了数字计算等数学方法的三方库,包括Rust中通用数学的数字特性。 10 11## 使用指导 12### 使用Openharmony编译框架 13在你的"BUILD.gn"中使用deps字段添加对num-traits crate的依赖,例如: 14 15```BUILD.gn 16ohos_rust_shared_library("foo") { 17 source = [ "src/lib.rs" ] 18 deps = [ "//third_party/rust/crates/num-traits:lib" ] 19} 20``` 21 22### 使用Cargo 23在你的 "Cargo.toml "中添加: 24 25``toml 26[dependencies] 27num-traits = "0.2" 28``` 29 30## 特性 31 32这个板块可以在没有标准库的情况下使用(`#![no_std]`),通过禁用 33默认的 "std "功能。在`Cargo.toml'中使用这个功能: 34 35```toml 36[dependencies.num-traits] 37version = "0.2" 38default-features = false 39# features = ["libm"] # <--- Uncomment if you wish to use `Float` and `Real` without `std` 40``` 41 42`Float`和`Real`特性只有在启用`std`或`libm`时才可用。 43`libm`特性仅在Rust 1.31及以后版本中可用([见PR #99](https://github.com/rust-num/num-traits/pull/99))。 44 45`FloatCore`特性始终可用。 用于`f32`的`MulAdd`和`MulAddAssign`也需要`f64`的`MulAddAssign`。 46和`f64`也需要`std`或`libm`,就像`Pow`中的有符号和浮点指数的实现。 47指数的实现也需要`pow'。 48 49`i128`和`u128`的实现只在Rust 1.26及以后的版本中可用。 50以后的版本。 构建脚本会自动检测到这一点,但你可以通过启用 "i128 "和 "u128 "来使它成为 51但你可以通过启用`i128'板块功能使其成为强制性的。 52 53## 发布 54 55发行说明可在[RELEASES.md](RELEASES.md)中找到。 56 57## 兼容性 58 59`num-traits`板块已在rustc 1.8及以上版本中测试。 60 61## 许可证 62 63使用以下任何一种许可证 64 65 * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) 66 * [MIT许可证](http://opensource.org/licenses/MIT) 67 68## 开发者贡献 69 70在使用该工具的过程中有任何问题欢迎开发者在社区issue中反馈。 71 72<br> 73
README.OpenSource
1[ 2 { 3 "Name": "num-traits", 4 "License": "Apache License V2.0, MIT", 5 "License File": "LICENSE-APACHE, LICENSE-MIT", 6 "Version Number": "num-traits-0.2.15", 7 "Owner": "fangting12@huawei.com", 8 "Upstream URL": "https://github.com/rust-num/num-traits", 9 "Description": "A Rust library that provides support for numeric traits like zero, one, and ordering." 10 } 11]
README.md
1# num-traits 2 3[](https://crates.io/crates/num-traits) 4[](https://docs.rs/num-traits) 5[](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) 6[](https://github.com/rust-num/num-traits/actions) 7 8Numeric traits for generic mathematics in Rust. 9 10## Usage 11 12Add this to your `Cargo.toml`: 13 14```toml 15[dependencies] 16num-traits = "0.2" 17``` 18 19## Features 20 21This crate can be used without the standard library (`#![no_std]`) by disabling 22the default `std` feature. Use this in `Cargo.toml`: 23 24```toml 25[dependencies.num-traits] 26version = "0.2" 27default-features = false 28# features = ["libm"] # <--- Uncomment if you wish to use `Float` and `Real` without `std` 29``` 30 31The `Float` and `Real` traits are only available when either `std` or `libm` is enabled. 32The `libm` feature is only available with Rust 1.31 and later ([see PR #99](https://github.com/rust-num/num-traits/pull/99)). 33 34The `FloatCore` trait is always available. `MulAdd` and `MulAddAssign` for `f32` 35and `f64` also require `std` or `libm`, as do implementations of signed and floating- 36point exponents in `Pow`. 37 38Implementations for `i128` and `u128` are only available with Rust 1.26 and 39later. The build script automatically detects this, but you can make it 40mandatory by enabling the `i128` crate feature. 41 42## Releases 43 44Release notes are available in [RELEASES.md](RELEASES.md). 45 46## Compatibility 47 48The `num-traits` crate is tested for rustc 1.8 and greater. 49 50## License 51 52Licensed under either of 53 54 * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) 55 * [MIT license](http://opensource.org/licenses/MIT) 56 57at your option. 58 59### Contribution 60 61Unless you explicitly state otherwise, any contribution intentionally submitted 62for inclusion in the work by you, as defined in the Apache-2.0 license, shall be 63dual licensed as above, without any additional terms or conditions. 64