---
name: "VarI8FromR8"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/VarI8FromR8"
---

# VarI8FromR8(3w)

## NAME

**VarI8FromR8** (OLEAUT32.336)

## SYNOPSIS

HRESULT VarI8FromR8\
  (\
   double  *dblIn*,\
   LONG64\* *pi64Out*\
  )

## DESCRIPTION

Convert a **VT\_R8** to a **VT\_I8**.

## PARAMS

*dblIn* **\[In\]**  Source.

*pi64Out* **\[Out\]**  Destination.

## RETURNS

**Success:** **S\_OK**.

**Failure:** **E\_INVALIDARG**, if the source value is invalid **DISP\_E\_OVERFLOW**, if the value will not fit in the destination.

## NOTES

Only values that fit into **63** bits are accepted. Due to rounding issues, very high or low values will not be accurately converted.

Numbers are rounded using Dutch rounding, as follows: \
\
   Fractional Part   Sign  Direction  Example\
\
   \---------------   ----  ---------  -------\
\
   \< 0.5              +    Down        0.4 -\>  0.0\
\
   \< 0.5              -    Up         -0.4 -\>  0.0\
\
   \> 0.5              +    Up          0.6 -\>  1.0\
\
   \< 0.5              -    Up         -0.6 -\> -1.0\
\
   \= 0.5              +    Up/Down    Down if even, Up if odd\
\
   \= 0.5              -    Up/Down    Up if even, Down if odd.

This system is often used in supermarkets.

## IMPLEMENTATION

Declared in **"oleauto.h"**.

Implemented in **"dlls/oleaut32/vartype.c"**.

Debug channel **"variant"**.
