Skip to content

Commit

Permalink
refactor: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
babiabeo committed Jun 9, 2024
1 parent d200d15 commit 6658b43
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/complex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isInf, isNaN2, isNumber, POS_INF } from "./utils.ts";
import { isInf, isNaN2, isNumber, POS_INF } from "./_utils.ts";

/** Type alias of {@linkcode Complex}. */
export type complex = Complex;
Expand Down
6 changes: 3 additions & 3 deletions src/math/exponential.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cmplx, type complex } from "../complex.ts";
import { isInf, isNaN2, POS_INF } from "../utils.ts";
import { isInf, isNaN2, POS_INF } from "../_utils.ts";

/**
* Returns the complex exponential of the complex argument `a`
Expand All @@ -20,7 +20,7 @@ export function exp(a: complex): complex {

if (isInf(r)) {
if (r > 0 && i === 0) {
return a;
return cmplx(r, i);
}

if (isInf(i) || isNaN2(i)) {
Expand All @@ -33,7 +33,7 @@ export function exp(a: complex): complex {
}

if (isNaN2(r) && i === 0) {
return a;
return cmplx(r, i);
}

const e = Math.exp(r);
Expand Down
2 changes: 1 addition & 1 deletion src/math/hyperbolic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cmplx, Complex, type complex } from "../complex.ts";
import { isInf, isNaN2, POS_INF, sign } from "../utils.ts";
import { isInf, isNaN2, POS_INF, sign } from "../_utils.ts";
import { acos, asin, atan } from "./trigonometric.ts";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/math/power.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cmplx, Complex, type complex } from "../complex.ts";
import { isInf, isNumber, POS_INF } from "../utils.ts";
import { isInf, isNumber, POS_INF } from "../_utils.ts";

/**
* Returns the square root of the complex number.
Expand Down
2 changes: 1 addition & 1 deletion src/math/trigonometric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
reducePi,
sign,
tans,
} from "../utils.ts";
} from "../_utils.ts";
import { log } from "./exponential.ts";
import { sqrt } from "./power.ts";

Expand Down
2 changes: 1 addition & 1 deletion tests/power_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test } from "@cross/test";
import { assertAlmostEquals, assertEquals } from "@std/assert";
import { pow, sqrt } from "../src/math/mod.ts";
import { cmplx, Complex } from "../src/complex.ts";
import { POS_INF } from "../src/utils.ts";
import { POS_INF } from "../src/_utils.ts";

test("Complex square root", () => {
assertEquals(sqrt(cmplx(0)), cmplx(0));
Expand Down

0 comments on commit 6658b43

Please sign in to comment.