PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/moul/x/daily/fractiondemo/v0

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v0
Namespace
moul / x / daily / fractiondemo
Files
3 (README)(gnomod.toml)
Exported functions
1
Module
gno.land/r/moul/x/daily/fractiondemo/v0
gno
0.9

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • fractiondemo.gnogno

Select a file to view its exact on-chain source. Sorted README → gnomod → sources → tests.

Functions

  • Render(path string) string

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗
# Fractions

Exact rational arithmetic, demoing the [`p/moul/x/daily/fraction`](/p/moul/x/daily/fraction/v0) library.

## A third, three times

`1/3 + 1/3 + 1/3` = **1**, exactly — not 0.9999…

As a decimal it is only ever an approximation: `0.3333333333`

## Arithmetic

| expression | result |
|---|---|
| `1/2 + 1/3` | `5/6` |
| `1/2 - 1/3` | `1/6` |
| `1/2 × 1/3` | `1/6` |
| `1/2 ÷ 1/3` | `3/2` |

## Exact comparison

`1/3` vs `33333/100000` — identical to five decimal places, yet the library still knows which is larger: **1/3 is greater**

> Comparison cross-multiplies, so it never takes a decimal detour. There are no floats here: on a chain, an answer that depends on rounding is a consensus bug.

vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.