Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

defMathConstants

defMathConstants( 
s_id 
) 
=> s_id

Description

Associates a set of predefined math constants as properties of the given symbol.

Arguments

s_id

The properties to be associated with the symbol are listed as name/value pairs.

The names are explained in the following table.

Name

Meaning

E

The base of natural logarithm. (e)

LOG2E

The base-2 logarithm of e

LOG10E

The base-10 logarithm of e

LN2

The natural logarithm of 2.

LN10

The natural logarithm of 10.

PI

The ratio of the circumference of a circle to its diameter. ( π )

PI_OVER_2

π /2

PI_OVER_4

π /4

ONE_OVER_PI

1/π

TWO_OVER_PI

2/π

TWO_OVER_SQRTPI

SQRT_TWO

The square root of 2.

SQRT_POINT_FIVE

The square root of 1/2.

INT_MAX

The maximum value of a SKILL integer.

INT_MIN

The minimum value of a SKILL integer is -2147483648. The minimum literal value which may appear in a program is -2147483647.

DBL_MAX

The maximum value of a SKILL double.

DBL_MIN

The minimum value of a SKILL double.

SHRT_MAX

The maximum value of a SKILL "short" integer.

SHRT_MIN

The minimum value of a SKILL "short" integer.

Value Returned

s_id

The symbol ID.

Examples

defMathConstants('m) 
=> m
m.?? => ( 
SQRT_POINT_FIVE 0.7071068
SQRT_TWO 1.414214
TWO_OVER_SQRTPI 1.128379
TWO_OVER_PI 0.6366198
ONE_OVER_PI 0.3183099
PI_OVER_4 0.7853982
PI_OVER_2 1.570796
PI 3.141593
LN10 2.302585
LN2 0.6931472
LOG10E 0.4342945
LOG2E 1.442695
E 2.718282
DBL_MIN 2.225074e-308
DBL_MAX 1.797693e+308
INT_MIN -2147483648
INT_MAX 2147483647
SHRT_MIN -32768
SHRT_MAX 32767)
m.SQRT_POINT_FIVE 
=> 0.7071068
m.INT_MIN 
=> -2147483648
m.PI 
=> 3.141593
printf(“%0.17f\n” m.PI) 
=> 3.14159265358979312

Related Topics

printf

getqq

plist

setplist

Arithmetic Functions


Return to top
 ⠀
X