Log InSign Up
Docs
  • Zoo Design Studio
  • Zoo Developer Tools
  • KCL Book
  • KCL Samples
  • KCL Language Reference
  • KCL Standard Library
    • Consts
    • Modules
    • Types
    • Functions
      • appearance::hexString
      • appearance::rgb
      • map
      • pop
      • push
      • reduce
      • assert
      • assertIs
      • clone
      • helix
      • abs
      • acos
      • asin
      • atan
      • atan2
      • ceil
      • cos
      • floor
      • legAngX
      • legAngY
      • legLen
      • ln
      • log
        • log10
        • log2
      • log10
      • log2
      • max
      • min
      • polar
      • pow
      • rem
      • round
      • sin
      • sqrt
      • tan
      • offsetPlane
      • angledLine
      • angledLineThatIntersects
      • arc
      • bezierCurve
      • circle
      • circleThreePoint
      • close
      • extrude
      • getCommonEdge
      • getNextAdjacentEdge
      • getOppositeEdge
      • getPreviousAdjacentEdge
      • involuteCircular
      • lastSegX
      • lastSegY
      • line
      • loft
      • patternCircular2d
      • patternLinear2d
      • patternTransform2d
      • polygon
      • profileStart
      • profileStartX
      • profileStartY
      • revolve
      • segAng
      • segEnd
      • segEndX
      • segEndY
      • segLen
      • segStart
      • segStartX
      • segStartY
      • startProfile
      • startSketchOn
      • subtract2d
      • sweep
      • tangentToEnd
      • tangentialArc
      • xLine
      • yLine
      • appearance
      • chamfer
      • fillet
      • hollow
      • intersect
      • patternCircular3d
      • patternLinear3d
      • patternTransform
      • shell
      • subtract
      • union
      • mirror2d
      • rotate
      • scale
      • translate
      • units::toCentimeters
      • units::toDegrees
      • units::toFeet
      • units::toInches
      • units::toMeters
      • units::toMillimeters
      • units::toRadians
      • units::toYards
  • Glossary
  • FAQ
  • Enterprise
kcl-std → functions → log2

log2Function in std::math

Compute the base 2 logarithm of the number.

log2(@input: number): number

Arguments

NameTypeDescriptionRequired
inputnumberA number.Yes

Returns

number - A number.

Examples

exampleSketch = startSketchOn(XZ)
  |> startProfile(at = [0, 0])
  |> line(end = [log2(100), 0])
  |> line(end = [5, 8])
  |> line(end = [-10, 0])
  |> close()

example = extrude(exampleSketch, length = 5)

Rendered example of log2 0

Found a typo?
Zoo

8701 Aviation Blvd

Inglewood, California 90301

    Product
  • Zoo Design Studio
  • Text-to-CAD
  • Download App
  • Release Notes
    Company
  • Careers
  • Research
  • Blog
  • Contact Sales
    Pricing
  • Zoo Design Pricing
  • API Pricing
    Resources
  • Tutorials
  • Developers
  • Support
  • Terms & Conditions
  • Privacy Policy
  • Security

Copyright © 2025 ZOO CORPORATION All rights reserved.