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

round

round( 
n_arg 
) 
=>  x_result

Description

Rounds a floating-point number to its closest integer value. If the given floating point argument n_arg is greater than the maximum integer value INT_MAX, a warning message displays and the INT_MAX value is returned. Similarly, if the floating point argument n_arg is less than the minimum integer value INT_MIN, a warning message displays and the INT_MIN value is returned.

Arguments

n_arg

Floating-point number.

Value Returned

x_result

Integer whose value is closest to n_arg.

Examples

round(1.5)        
=> 2
round(-1.49)
=> -1
round(1.49)
=> 1
round(1.111111e10)
=>2147483647
round(-1.1234e20)
=>-2147483648

Related Topics

fix

float


Return to top
 ⠀
X