Files
modeling-app/docs/kcl/log.md
Paul Tagliamonte c84c0b0fef return errors back to user (#4075)
* Log any Errors to stderr

This isn't perfect -- in fact, this is maybe not even very good at all,
but it's better than what we have today.

Currently, when we get an Erorr back from the WebSocket, we drop it in
kcl-lib. The web-app logs these to the console (I can't find my commit
doing that off the top of my head, but I remember doing it) -- so this
is some degree of partity.

This won't be very useful at all for wasm usage, but it will fix issues
with the zoo cli silently breaking with a "WebSocket Closed" error --
which is the same issue I was solving for in the desktop app too.

In the future perhaps this can be a real Error? I'm not totally sure
yet, since we can't align to the request-id, so we can't really tie it
to a specific call (yet).

* add to responses

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* add a test

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* clippy[

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* empty

* fix error

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-10-02 22:05:12 -07:00

73 KiB

title, excerpt, layout
title excerpt layout
log Compute the logarithm of the number with respect to an arbitrary base. manual

Compute the logarithm of the number with respect to an arbitrary base.

The result might not be correctly rounded owing to implementation details; log2() can produce more accurate results for base 2, and log10() can produce more accurate results for base 10.

log(num: number, base: number) -> number

Tags

  • math

Arguments

Name Type Description Required
num number Yes
base number Yes

Returns

number

Examples

exampleSketch = startSketchOn("XZ")
  |> startProfileAt([0, 0], %)
  |> line([log(100, 5), 0], %)
  |> line([5, 8], %)
  |> line([-10, 0], %)
  |> close(%)

example = extrude(5, exampleSketch)

Rendered example of log 0