Skip to content

Commit

Permalink
Fix memory prefix function values (#205)
Browse files Browse the repository at this point in the history
* Fix memory prefix function values

* Add changelog
  • Loading branch information
jscheiny authored Oct 23, 2024
1 parent 70d7173 commit f1adb02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v2.0.2
- Fixed an issue where large memory prefix functions (`tebi` and up) were using the wrong scalar values.

## v2.0.0

**Breaking changes**
Expand Down
10 changes: 5 additions & 5 deletions src/unit/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const bytes: Memory = Measure.of(8, bits, "B");
export const kibi: PrefixFn = Measure.prefix("Ki", 1 << 10);
export const mebi = Measure.prefix("Mi", 1 << 20);
export const gibi = Measure.prefix("Gi", 1 << 30);
export const tebi = Measure.prefix("Ti", 1 << 40);
export const pibi = Measure.prefix("Pi", 1 << 50);
export const exbi = Measure.prefix("Ei", 1 << 60);
export const zebi = Measure.prefix("Zi", 1 << 70);
export const yobi = Measure.prefix("Yi", 1 << 80);
export const tebi = Measure.prefix("Ti", Math.pow(2, 40));
export const pibi = Measure.prefix("Pi", Math.pow(2, 50));
export const exbi = Measure.prefix("Ei", Math.pow(2, 60));
export const zebi = Measure.prefix("Zi", Math.pow(2, 70));
export const yobi = Measure.prefix("Yi", Math.pow(2, 80));

0 comments on commit f1adb02

Please sign in to comment.