User Tools

Site Tools


Sidebar

Home



G-Code


About

  Order of execution
  Parameters

G-Codes

M-Codes

Other Codes

O-Words

Comments

Functions

  abs[]
  acos[]
  active[]
  and[]
  asin[]
  atan2[]
  atan[]
  bin[]
  ceil[]
  chr[]
  cos[]
  datetime[]
  day[]
  dec[]
  defnz[]
  def[]
  deg2rad[]
  exists[]
  exp10[]
  exp2[]
  expr[][]
  exp[]
  e[]
  fix[]
  floor[]
  froms16[]
  froms32[]
  fromu16[]
  fromu32[]
  fup[]
  hex[]
  hour[]
  inc[]
  land[]
  lnand[]
  lnor[]
  lnot[]
  log10[]
  log2[]
  log[]
  lor[]
  lxnor[]
  lxor[]
  max3[]
  max[]
  millisec[]
  min3[]
  minute[]
  min[]
  mmtounit[]
  month[]
  nand[]
  nan[]
  nop[][]
  nor[]
  notexists[]
  not[]
  or[]
  pi[]
  pow[]
  rad2deg[]
  rand[]
  rounddec[]
  roundup[]
  round[]
  s16[]
  s32[]
  s8[]
  second[]
  shl[]
  shr[]
  sin[]
  sqrt[]
  sqr[]
  tan[]
  tomachine[]
  tos16[]
  tos32[]
  tou16[]
  tou32[]
  towork[]
  trunc[]
  u16[]
  u32[]
  u8[]
  unittomm[]
  xnor[]
  xor[]
  year[]

Operators

Macros

gcode:functions:func-pow

pow[]

Raise to power.

Returns base raised to the power xy.

The pow[] function is a function that returns the value of a number raised to a specified power. The function takes two arguments: the number (x) and the exponent (y). The output will be a float.

For example, pow[2, 3] would return 8, and pow[5, 2] would return 25.

The pow[] function is commonly used in mathematics, physics, engineering and other fields, such as solving equations involving exponentials and logarithms, as well as in various algorithms and data analysis. It's also used in many areas of science and engineering, such as probability and statistics, finance, and physics.

It's also worth noting that you can use *⁠* operator as a shorthand for pow function. For example 2 *⁠* 3 is equivalent to pow[2,3].

Syntax

pow[x, y]

Parameters

x Base value.
y Exponent value.
Return Value The result of raising base x to the power exponent y.

Examples

#<result> = pow[7, 3]
(print,#<result>)

result: 343


#<result> = pow[4.73, 12]
(print,#<result>)

result: 125410439.217423


#<result> = pow[32.01, 1.54]
(print,#<result>)

result: 208.036691

See also

gcode/functions/func-pow.txt · Last modified: 2023/01/26 23:03 by 127.0.0.1

Page Tools