gi-cogl-1.0.2: COGL GObject bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Cogl.Objects.Fixed

Description

Fixed point number using a (16.16) notation.

Synopsis

Exported types

newtype Fixed Source #

Memory-managed wrapper type.

Constructors

Fixed (ManagedPtr Fixed) 

Instances

Instances details
Eq Fixed Source # 
Instance details

Defined in GI.Cogl.Objects.Fixed

Methods

(==) :: Fixed -> Fixed -> Bool #

(/=) :: Fixed -> Fixed -> Bool #

BoxedPtr Fixed Source # 
Instance details

Defined in GI.Cogl.Objects.Fixed

ManagedPtrNewtype Fixed Source # 
Instance details

Defined in GI.Cogl.Objects.Fixed

TypedObject Fixed Source # 
Instance details

Defined in GI.Cogl.Objects.Fixed

Methods

glibType :: IO GType #

HasParentTypes Fixed Source # 
Instance details

Defined in GI.Cogl.Objects.Fixed

type ParentTypes Fixed Source # 
Instance details

Defined in GI.Cogl.Objects.Fixed

type ParentTypes Fixed = '[] :: [Type]

class (BoxedPtr o, TypedObject o, IsDescendantOf Fixed o) => IsFixed o Source #

Type class for types which can be safely cast to Fixed, for instance with toFixed.

Instances

Instances details
(BoxedPtr o, TypedObject o, IsDescendantOf Fixed o) => IsFixed o Source # 
Instance details

Defined in GI.Cogl.Objects.Fixed

toFixed :: (MonadIO m, IsFixed o) => o -> m Fixed Source #

Cast to Fixed, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

pow2.

Getters

None.

Setters

None.

pow

fixedPow Source #

Arguments

:: (HasCallStack, MonadIO m, IsFixed a) 
=> Word32

x: base

-> a

y: CoglFixed exponent

-> m Word32

Returns: the power of x to the y

Calculates x to the y power.

Since: 1.0

pow2

fixedPow2 Source #

Arguments

:: (HasCallStack, MonadIO m, IsFixed a) 
=> a

x: a CoglFixed number

-> m Word32

Returns: the power of 2 to the passed value

Calculates 2 to the x power.

This function is around 11 times faster on x86, and around 22 times faster on fpu-less arm than libc pow(2, x).

Since: 1.0