std-sqr


Synopsis

(std-sqr <num>)

Description

Returns the square, the number multiplied with itself. The return value depends on the argument type and the supported number range.

Examples

(std-sqr 2.0)	=> 4.0
(std-sqr 2)	=> 4
(std-sqr 25)	=> 625
(std-sqr 625)	=> 390625
(std-sqr 390625)	=> 1.52588e+011

; but (* 390625 390625) => -2030932031 ;!!wrong

(std-sqr (sqrt 25))	=> 25.0

Note that AutoLISP or Vital LISP return wrong numbers on range overflow. The number is not correctly converted to real, but std-sqr assures a correct return value converting the result value to real if necessary.

Arguments

num: Any number, if integer or real.

Return Value

A integer or real number.

Side Effects

None.

Module

(std-require 'STDMATH)

Defined in STDMATH