From 7a1b56918b7c31f2f48a58d709862baba3721423 Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Sun, 12 May 2024 15:59:19 +0300 Subject: [PATCH] Add a note to linear() on the consequences of losing virtual AST node ref #310 --- documentation/BUILTIN.md | 4 ++-- src/stdlib/builtin.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/documentation/BUILTIN.md b/documentation/BUILTIN.md index 65faebc2..d4de70bc 100644 --- a/documentation/BUILTIN.md +++ b/documentation/BUILTIN.md @@ -229,13 +229,13 @@ Obtain the smallest (linear) interval that shares both arguments as multiplicati Return the number of intervals in the scale. ### linear(*interval*) -Convert interval to linear representation. +Convert interval to linear representation. Formatting information of logarithmic quantities is lost. ### log1p(*x*) Calculate log1p x. ### logarithmic(*interval*) -Convert interval to logarithmic representation. +Convert interval to logarithmic representation. Formatting information of linear quantities is lost. ### map(*mapper*, *scale = $$*) Map a riff over the given/current scale producing a new scale. diff --git a/src/stdlib/builtin.ts b/src/stdlib/builtin.ts index 2a23cd26..3d2d39f7 100644 --- a/src/stdlib/builtin.ts +++ b/src/stdlib/builtin.ts @@ -382,7 +382,8 @@ function linear( } return unaryBroadcast.bind(this)(interval, linear.bind(this)); } -linear.__doc__ = 'Convert interval to linear representation.'; +linear.__doc__ = + 'Convert interval to linear representation. Formatting information of logarithmic quantities is lost.'; linear.__node__ = builtinNode(linear); function logarithmic( @@ -395,7 +396,8 @@ function logarithmic( } return unaryBroadcast.bind(this)(interval, logarithmic.bind(this)); } -logarithmic.__doc__ = 'Convert interval to logarithmic representation.'; +logarithmic.__doc__ = + 'Convert interval to logarithmic representation. Formatting information of linear quantities is lost.'; logarithmic.__node__ = builtinNode(logarithmic); function absolute(