Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
tdelmas authored Sep 11, 2024
1 parent 051472d commit af0d525
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ In that example:

Most methods and traits available on the underlying type are available on the types of this crate.

Most constants are also available, with the most appropriate `TypedFloat` type (except `NAN` for obvious reasons) in the [`tf64`] and [`tf32`] modules (in [`tf64::consts`] and [`tf32::consts`] respectively when the constant comes from [`core::f64::consts`] or [`core::f32::consts`]). Those modules are named that way to avoid conflicts or confusion with the primitives [`f32`] and [`f64`].
Most constants are also available, with the most appropriate TypedFloat type (except `NAN` for obvious reasons) in the [`tf64`] and [`tf32`] modules (in [`tf64::consts`] and [`tf32::consts`] respectively when the constant comes from [`core::f64::consts`] or [`core::f32::consts`]). Those modules are named that way to avoid conflicts or confusion with the primitives [`f32`] and [`f64`].

⚠️ Like for primitives [`f32`] and [`f64`],`-0.0 == +0.0` is `true` for all types of this crate.
To facilitate comparisons, the methods `is_positive_zero` and `is_negative_zero` are added.
Expand Down
4 changes: 2 additions & 2 deletions typed_floats/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![doc = include_str!("../README.truncated.md")]
//! # Rules
//!
//! Conversions rules for operations are summarized in [`TypedFloat`].
//! Conversions rules for operations are summarized in [`doc`].
//!
//! # Examples
//!
Expand Down Expand Up @@ -127,7 +127,7 @@ pub use traits::*;
pub use types::*;

typed_floats_macros::generate_docs!(
pub trait TypedFloat {}
pub mod doc {}
);

/// This module contains constants from [`core::f64`], casted to the corresponding type
Expand Down
2 changes: 1 addition & 1 deletion typed_floats/src/types/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// An error that can occur when converting from a string into a `TypedFloat`
/// An error that can occur when converting from a string into a TypedFloat
#[derive(Debug)]
pub enum FromStrError {
/// The string did not contain a valid float number
Expand Down

0 comments on commit af0d525

Please sign in to comment.