new_point CPoint:delete

CPoint:Ceil


The Ceil method replaces the x and y values of the CPoint with the next higher integer, or "ceiling" value. For example, x=1.3 becomes x=2, and x=-16.2 becomes x=-16.

Syntax

P = CPoint:Ceil()

bullet.gif    P returned is the original CPoint object. This allows the Ceil method to be used as part of an operator expression, if desired.

bullet.gif    On failure, nil is returned.

Example

The following script creates a CPoint object and applies the Ceil method to its values.

P = new_point(4.4,-12.7)

-- create a CPoint object

Printf("x=%lg, y=%lg\n", P.x, P.y)

-- result: x=4.4, y=-12.7

P:Ceil()

-- compute the ceiling values

Printf("x=%lg, y=%lg\n", P.x, P.y)

-- result: x=5, y=-12

Related Topics

CPoint class, Floor, Round, CPoint Math Operators


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.