Skip to content

Commit

Permalink
Add a note to linear() on the consequences of losing virtual AST node
Browse files Browse the repository at this point in the history
ref #310
  • Loading branch information
frostburn committed May 12, 2024
1 parent 08a38d2 commit 7a1b569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions documentation/BUILTIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions src/stdlib/builtin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 7a1b569

Please sign in to comment.