Skip to content

Commit

Permalink
Fix incorrect comment on signum function for integer vectors. (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
PennyMew authored Feb 4, 2023
1 parent 01af708 commit 50ef6ea
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions codegen/templates/vec.rs.tera
Original file line number Diff line number Diff line change
Expand Up @@ -801,9 +801,15 @@ impl {{ self_t }} {

/// Returns a vector with elements representing the sign of `self`.
///
{% if is_float -%}
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
/// - `NAN` if the number is `NAN`
{%- else -%}
/// - `0` if the number is zero
/// - `1` if the number is positive
/// - `-1` if the number is negative
{%- endif %}
#[inline]
pub fn signum(self) -> Self {
{% if is_scalar %}
Expand Down
6 changes: 3 additions & 3 deletions src/i32/ivec2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ impl IVec2 {

/// Returns a vector with elements representing the sign of `self`.
///
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
/// - `NAN` if the number is `NAN`
/// - `0` if the number is zero
/// - `1` if the number is positive
/// - `-1` if the number is negative
#[inline]
pub fn signum(self) -> Self {
Self {
Expand Down
6 changes: 3 additions & 3 deletions src/i32/ivec3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ impl IVec3 {

/// Returns a vector with elements representing the sign of `self`.
///
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
/// - `NAN` if the number is `NAN`
/// - `0` if the number is zero
/// - `1` if the number is positive
/// - `-1` if the number is negative
#[inline]
pub fn signum(self) -> Self {
Self {
Expand Down
6 changes: 3 additions & 3 deletions src/i32/ivec4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ impl IVec4 {

/// Returns a vector with elements representing the sign of `self`.
///
/// - `1.0` if the number is positive, `+0.0` or `INFINITY`
/// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY`
/// - `NAN` if the number is `NAN`
/// - `0` if the number is zero
/// - `1` if the number is positive
/// - `-1` if the number is negative
#[inline]
pub fn signum(self) -> Self {
Self {
Expand Down

0 comments on commit 50ef6ea

Please sign in to comment.