struct

CrImage::Math::Fixed::Int52_12

Inherits Struct / Value / Object

Int52_12 is a signed 52.12 fixed-point number. The Integer part ranges from -2251799813685248 to 2251799813685247. The fractional part has 12 bits of precision.

For example, the number one-and-a-quarter is Int26_6[1<<12 + 1<<10].

Class methods

[](value : Number)
Source
from_i(i : Int)

returns the integer value i as in Int52_12

Source

Instance methods

*(y : Int52_12)
Source
*(y : Number)
Source
+(y : Int52_12)
Source
-(y : Int52_12)
Source
<(y : Int52_12)
Source
<=(y : Int52_12)
Source
==(y : Int52_12)
Source
==(y : Number)
Source
>(y : Int52_12)
Source
>=(y : Int52_12)
Source
ceil

ceil returns the least integer value less than or equal to @val.

Its return is Int64, not Int52_12

Source
floor

floor returns the greatest integer value less than or equal to @val.

Its return is Int64, not Int52_12

Source
round

round returns the nearest integer value to @val. Ties are rounded up.

Its return is Int64, not Int52_12

Source
to_i
Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source
to_s

returns human-readable representation of 52.12 fixed-point number. For example, the number one-and-a-quarter becomes &quot;1:1024&quot;.

Source

Macros

method_missing(call)
Source