Decimal classes

Decimal classes

Functions

Types and Values

Includes

#include <arrow-glib/arrow-glib.h>

Description

GArrowDecimal128 is a 128-bit decimal class.

Functions

garrow_decimal128_new_string ()

GArrowDecimal128 *
garrow_decimal128_new_string (const gchar *data);

Parameters

data

The data of the decimal.

 

Returns

A newly created GArrowDecimal128.

Since: 0.10.0


garrow_decimal128_new_integer ()

GArrowDecimal128 *
garrow_decimal128_new_integer (const gint64 data);

Parameters

data

The data of the decimal.

 

Returns

A newly created GArrowDecimal128.

Since: 0.10.0


garrow_decimal128_to_string_scale ()

gchar *
garrow_decimal128_to_string_scale (GArrowDecimal128 *decimal,
                                   gint32 scale);

Parameters

decimal

A GArrowDecimal128.

 

scale

The scale of the decimal.

 

Returns

The string representation of the decimal.

It should be freed with g_free() when no longer needed.

Since: 0.10.0


garrow_decimal128_to_string ()

gchar *
garrow_decimal128_to_string (GArrowDecimal128 *decimal);

Parameters

decimal

A GArrowDecimal128.

 

Returns

The string representation of the decimal.

It should be freed with g_free() when no longer needed.

Since: 0.10.0


garrow_decimal128_abs ()

void
garrow_decimal128_abs (GArrowDecimal128 *decimal);

Computes the absolute value of the decimal destructively.

Parameters

decimal

A GArrowDecimal128.

 

Since: 0.10.0


garrow_decimal128_negate ()

void
garrow_decimal128_negate (GArrowDecimal128 *decimal);

Negate the current value of the decimal destructively.

Parameters

decimal

A GArrowDecimal128.

 

Since: 0.10.0


garrow_decimal128_to_integer ()

gint64
garrow_decimal128_to_integer (GArrowDecimal128 *decimal);

Parameters

decimal

A GArrowDecimal128.

 

Returns

The 64-bit integer representation of the decimal.

Since: 0.10.0


garrow_decimal128_plus ()

GArrowDecimal128 *
garrow_decimal128_plus (GArrowDecimal128 *left,
                        GArrowDecimal128 *right);

Parameters

left

A GArrowDecimal128.

 

right

A GArrowDecimal128.

 

Returns

The added value of these decimals.

[transfer full]

Since: 0.11.0


garrow_decimal128_minus ()

GArrowDecimal128 *
garrow_decimal128_minus (GArrowDecimal128 *left,
                         GArrowDecimal128 *right);

Parameters

left

A GArrowDecimal128.

 

right

A GArrowDecimal128.

 

Returns

The subtracted value of these decimals.

[transfer full]

Since: 0.11.0


garrow_decimal128_multiply ()

GArrowDecimal128 *
garrow_decimal128_multiply (GArrowDecimal128 *left,
                            GArrowDecimal128 *right);

Parameters

left

A GArrowDecimal128.

 

right

A GArrowDecimal128.

 

Returns

The multiplied value of these decimals.

[transfer full]

Since: 0.11.0


garrow_decimal128_divide ()

GArrowDecimal128 *
garrow_decimal128_divide (GArrowDecimal128 *left,
                          GArrowDecimal128 *right,
                          GArrowDecimal128 **remainder,
                          GError **error);

Parameters

left

A GArrowDecimal128.

 

right

A GArrowDecimal128.

 

remainder

A return location for the remainder value of these decimals. The returned GArrowDecimal128 be unreferred with g_object_unref() when no longer needed.

[out][nullable]

error

Return location for a GError or NULL.

[nullable]

Returns

The divided value of these decimals or NULL on error.

[nullable][transfer full]

Since: 0.11.0

Types and Values

GARROW_TYPE_DECIMAL128

#define GARROW_TYPE_DECIMAL128 (garrow_decimal128_get_type())

struct GArrowDecimal128Class

struct GArrowDecimal128Class {
  GObjectClass parent_class;
};