Skip to content

docs: improve module doc comments#17

Merged
nberlette merged 86 commits intomainfrom
docs/module-docs
Jan 24, 2026
Merged

docs: improve module doc comments#17
nberlette merged 86 commits intomainfrom
docs/module-docs

Conversation

@nberlette
Copy link
Copy Markdown
Owner

@nberlette nberlette commented Jan 24, 2026

  • docs(abs): improve doc comments in abs.ts
  • docs(acos): improve doc comments in acos.ts
  • docs(acosh): improve doc comments in acosh.ts
  • docs(asin): improve doc comments in asin.ts
  • docs(asinh): improve doc comments in asinh.ts
  • docs(atan): improve doc comments in atan.ts
  • docs(atan2): improve doc comments in atan2.ts
  • docs(atanh): improve doc comments in atanh.ts
  • docs(cbrt): improve doc comments in cbrt.ts
  • docs(ceil): improve doc comments in ceil.ts
  • docs(clamp): improve doc comments in clamp.ts
  • docs(clz32): improve doc comments in clz32.ts
  • docs(constants): improve doc comments in constants/e.ts
  • docs(constants): improve doc comments in constants/epsilon.ts
  • docs(constants): improve doc comments in constants/index.ts
  • docs(constants): improve doc comments in constants/infinity.ts
  • docs(constants): improve doc comments in constants/ln10.ts
  • docs(constants): improve doc comments in constants/ln2.ts
  • docs(constants): improve doc comments in constants/log10e.ts
  • docs(constants): improve doc comments in constants/log2e.ts
  • docs(constants): improve doc comments in constants/max_safe_integer.ts
  • docs(constants): improve doc comments in constants/max_value.ts
  • docs(constants): improve doc comments in constants/min_safe_integer.ts
  • docs(constants): improve doc comments in constants/min_value.ts
  • docs(constants): improve doc comments in constants/nan.ts
  • docs(constants): improve doc comments in constants/negative_infinity.ts
  • docs(constants): improve doc comments in constants/pi.ts
  • docs(constants): improve doc comments in constants/positive_infinity.ts
  • docs(constants): improve doc comments in constants/positive_zero.ts
  • docs(constants): improve doc comments in constants/sqrt1_2.ts
  • docs(constants): improve doc comments in constants/sqrt2.ts
  • docs(cos): improve doc comments in cos.ts
  • docs(cosh): improve doc comments in cosh.ts
  • docs(exp): improve doc comments in exp.ts
  • docs(expm1): improve doc comments in expm1.ts
  • docs(f16round): improve doc comments in f16round.ts
  • docs(float16): improve doc comments in float16/constants.ts
  • docs(float16): improve doc comments in float16/decode.ts
  • docs(float16): improve doc comments in float16/encode.ts
  • docs(float16): improve doc comments in float16/guards.ts
  • docs(float16): improve doc comments in float16/index.ts
  • docs(float16): improve doc comments in float16/round.ts
  • docs(float32): improve doc comments in float32/constants.ts
  • docs(float32): improve doc comments in float32/decode.ts
  • docs(float32): improve doc comments in float32/encode.ts
  • docs(float32): improve doc comments in float32/guards.ts
  • docs(float32): improve doc comments in float32/index.ts
  • docs(float32): improve doc comments in float32/round.ts
  • docs(floor): improve doc comments in floor.ts
  • docs(fround): improve doc comments in fround.ts
  • docs(guards): improve doc comments in guards/finite.ts
  • docs(guards): improve doc comments in guards/index.ts
  • docs(guards): improve doc comments in guards/infinity.ts
  • docs(guards): improve doc comments in guards/integer.ts
  • docs(guards): improve doc comments in guards/negative_infinity.ts
  • docs(guards): improve doc comments in guards/negative_zero.ts
  • docs(guards): improve doc comments in guards/positive_infinity.ts
  • docs(guards): improve doc comments in guards/positive_zero.ts
  • docs(guards): improve doc comments in guards/safe_integer.ts
  • docs(hypot): improve doc comments in hypot.ts
  • docs(ieee754): improve doc comments in ieee754.ts
  • docs(imul): improve doc comments in imul.ts
  • docs(index): improve doc comments in index.ts
  • docs(log): improve doc comments in log.ts
  • docs(log10): improve doc comments in log10.ts
  • docs(log1p): improve doc comments in log1p.ts
  • docs(log2): improve doc comments in log2.ts
  • docs(max): improve doc comments in max.ts
  • docs(min): improve doc comments in min.ts
  • docs(pow): improve doc comments in pow.ts
  • docs(random): improve doc comments in random.ts
  • docs(round): improve doc comments in round.ts
  • docs(sign): improve doc comments in sign.ts
  • docs(sin): improve doc comments in sin.ts
  • docs(sinh): improve doc comments in sinh.ts
  • docs(sqrt): improve doc comments in sqrt.ts
  • docs(tan): improve doc comments in tan.ts
  • docs(tanh): improve doc comments in tanh.ts
  • docs(trunc): improve doc comments in trunc.ts
  • docs(types): improve doc comments in types/finite.ts
  • docs(types): improve doc comments in types/float.ts
  • docs(types): improve doc comments in types/index.ts
  • docs(types): improve doc comments in types/integer.ts
  • docs(types): improve doc comments in types/precision.ts
  • docs(types): improve doc comments in types/safe_integer.ts

@nberlette nberlette added the documentation Improvements or additions to documentation label Jan 24, 2026
Copilot AI review requested due to automatic review settings January 24, 2026 06:18
@nberlette nberlette added the documentation Improvements or additions to documentation label Jan 24, 2026
@nberlette nberlette merged commit 2e3cb48 into main Jan 24, 2026
7 checks passed
@nberlette nberlette deleted the docs/module-docs branch January 24, 2026 06:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR systematically improves documentation across the entire @nick/math library by adding module-level doc comments with practical code examples. The changes add @example blocks demonstrating typical usage patterns for constants, mathematical functions, type guards, and floating-point utilities.

Changes:

  • Added comprehensive module-level documentation examples to ~85 files across the library
  • Introduced jsr:@nick/is@0.2.0-rc.6 dependency for type assertion examples in documentation
  • Removed FloatFormat type constraint from float16 and float32 constants (intentional simplification)
  • Enhanced random.ts with namespace declarations for better TypeScript documentation

Reviewed changes

Copilot reviewed 85 out of 86 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
deno.lock Added dependency for @nick/is package used in doc examples
src/types/*.ts Added module doc comments with type-level examples using expectType
src/constants/*.ts Added module doc comments with runtime examples comparing to Math/Number constants
src/guards/*.ts Added module doc comments with type guard examples
src/float16/*.ts Added module doc comments for IEEE-754 half-precision utilities
src/float32/*.ts Added module doc comments for IEEE-754 single-precision utilities, removed FloatFormat constraint
src/*.ts (math functions) Added module doc comments with practical usage examples
src/random.ts Added namespace declarations for init() and integer() methods
src/index.ts Added @category tag for the main module

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/types/precision.ts
* @example
* ```ts
* import type { P32, Precision } from "@nick/math/types/precision";
* import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";;
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double semicolon at the end of the import statement in the code example. Remove one semicolon.

Copilot uses AI. Check for mistakes.
Comment thread src/types/integer.ts
* @example
* ```ts
* import type { Int32 } from "@nick/math/types/integer";
* import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";;
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double semicolon at the end of the import statement in the code example. Remove one semicolon.

Copilot uses AI. Check for mistakes.
Comment thread src/types/float.ts
* @example
* ```ts
* import type { Float32 } from "@nick/math/types/float";
* import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";;
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double semicolon at the end of the import statement in the code example. Remove one semicolon.

Copilot uses AI. Check for mistakes.
Comment thread src/types/finite.ts
* @example
* ```ts
* import type { Finite } from "@nick/math/types/finite";
* import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";;
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double semicolon at the end of the import statement in the code example. Remove one semicolon.

Copilot uses AI. Check for mistakes.
Comment thread src/types/safe_integer.ts
*
* @example
* ```ts
* import { isSafeInteger } from "@nick/math/is/safe-integer";
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect import path in the example. The isSafeInteger function is exported from @nick/math/guards/safe-integer, not @nick/math/is/safe-integer. There is no is directory in the project structure.

Copilot uses AI. Check for mistakes.
Comment thread src/types/safe_integer.ts
* ```ts
* import { isSafeInteger } from "@nick/math/is/safe-integer";
* import type { SafeInteger } from "@nick/math/types/safe-integer";
* import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";;
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double semicolon at the end of the import statement in the code example. Remove one semicolon.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants