---
title: float_invert
description: Divide one by an XFL floating point number
---
import { Tabs, TabItem, LinkButton } from '@astrojs/starlight/components';

### Concepts

<LinkButton href="/docs/hooks/concepts/floating-point-numbers-xfl">Floating Point Numbers (XFL)</LinkButton>

### Behaviour

<Tabs>
<TabItem label="C">
* Inverts a float representation.
* Return a inverted float as a bigint or an ErrorCode
</TabItem>

<TabItem label="JavaScript">
* Divide `1` by an XFL
* Return a new XFL as an int64_t
</TabItem>
</Tabs>



### Definition

<Tabs>
<TabItem label="C">
```c
int64_t float_invert (
    int64_t float1
);
```


</TabItem>

<TabItem label="JavaScript">
```javascript
function float_invert(f1: bigint): ErrorCode | bigint
```
</TabItem>
</Tabs>



### Example

<Tabs>
<TabItem label="C">
```c
int64_t still_one =
    float_invert(float_one());
```
</TabItem>

<TabItem label="JavaScript">
```javascript
const still_one =
    float_invert(float_one())
```
</TabItem>
</Tabs>



### Parameters

<Tabs>
<TabItem label="C">
| Name   | Type     | Description                            |
| ------ | -------- | -------------------------------------- |
| float1 | int64_t | An XFL floating point enclosing number |
</TabItem>

<TabItem label="JavaScript">
| Name | Type  | Description         |
| ---- | ----- | ------------------- |
| f1   | float | The float to invert |
</TabItem>
</Tabs>



### Return Code

<Tabs>
<TabItem label="C">
| Type     | Description                                                                                                                                                                                                                                                                                                    |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| int64_t | <p>The XFL (xls17) enclosing number<br /><br />If negative, an error:<br /><code>INVALID_FLOAT</code><br />- the supplied parameter was not a valid XFL enclosing number or the division resulted in an XFL that cannot be represented.<br /><br /><code>DIVISION_BY_ZERO</code><br />- the supplied parameter was zero.</p> |
</TabItem>

<TabItem label="JavaScript">
| Type                | Description                                      |
| ------------------- | ------------------------------------------------ |
| ErrorCode \| bigint | An error code or the inverted float as a bigint. |
</TabItem>
</Tabs>

