From a60b85b538c9131869bde5e5e196f6aa23763090 Mon Sep 17 00:00:00 2001 From: Denis Chevalier Date: Mon, 10 Aug 2026 22:34:36 +0200 Subject: rename assert_aeq.typ and apply_prefix.typ s/_/-/ --- lib/apply-prefix.typ | 12 ++++++++++++ lib/apply_prefix.typ | 12 ------------ lib/assert-aeq.typ | 3 +++ lib/assert_aeq.typ | 3 --- module-design.typ | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 lib/apply-prefix.typ delete mode 100644 lib/apply_prefix.typ create mode 100644 lib/assert-aeq.typ delete mode 100644 lib/assert_aeq.typ diff --git a/lib/apply-prefix.typ b/lib/apply-prefix.typ new file mode 100644 index 0000000..f6bbfb7 --- /dev/null +++ b/lib/apply-prefix.typ @@ -0,0 +1,12 @@ +#let apply-prefix(value, prefix) = { + if prefix == "tera" { return value * calc.pow(10, 12) } + if prefix == "giga" { return value * calc.pow(10, 9) } + if prefix == "mega" { return value * calc.pow(10, 6) } + if prefix == "kilo" { return value * calc.pow(10, 3) } + if prefix == "milli" { return value * calc.pow(10, -3) } + if prefix == "micro" { return value * calc.pow(10, -6) } + if prefix == "nano" { return value * calc.pow(10, -9) } + if prefix == "pico" { return value * calc.pow(10, -12) } + if prefix == "femto" { return value * calc.pow(10, -15) } + return value +} diff --git a/lib/apply_prefix.typ b/lib/apply_prefix.typ deleted file mode 100644 index f6bbfb7..0000000 --- a/lib/apply_prefix.typ +++ /dev/null @@ -1,12 +0,0 @@ -#let apply-prefix(value, prefix) = { - if prefix == "tera" { return value * calc.pow(10, 12) } - if prefix == "giga" { return value * calc.pow(10, 9) } - if prefix == "mega" { return value * calc.pow(10, 6) } - if prefix == "kilo" { return value * calc.pow(10, 3) } - if prefix == "milli" { return value * calc.pow(10, -3) } - if prefix == "micro" { return value * calc.pow(10, -6) } - if prefix == "nano" { return value * calc.pow(10, -9) } - if prefix == "pico" { return value * calc.pow(10, -12) } - if prefix == "femto" { return value * calc.pow(10, -15) } - return value -} diff --git a/lib/assert-aeq.typ b/lib/assert-aeq.typ new file mode 100644 index 0000000..70b9e64 --- /dev/null +++ b/lib/assert-aeq.typ @@ -0,0 +1,3 @@ +#let assert-aeq(left, right, precision: calc.pow(10, -6)) = { + assert(calc.abs(left - right) < precision) +} diff --git a/lib/assert_aeq.typ b/lib/assert_aeq.typ deleted file mode 100644 index 70b9e64..0000000 --- a/lib/assert_aeq.typ +++ /dev/null @@ -1,3 +0,0 @@ -#let assert-aeq(left, right, precision: calc.pow(10, -6)) = { - assert(calc.abs(left - right) < precision) -} diff --git a/module-design.typ b/module-design.typ index c776558..54fba92 100644 --- a/module-design.typ +++ b/module-design.typ @@ -1,6 +1,6 @@ #import "lib/unify.typ": num, qty, qtyrange, unit -#import "lib/apply_prefix.typ": apply-prefix -#import "lib/assert_aeq.typ": assert-aeq +#import "lib/apply-prefix.typ": apply-prefix +#import "lib/assert-aeq.typ": assert-aeq #import "@preview/diverential:0.3.0": * #import "@preview/cetz:0.5.2" #import "@preview/cetz-plot:0.1.4": plot -- cgit