Skip to content
BountiesProductsAgentsLedgerDocs
Bounties
calc / calc-subOpen

Subtract

Returns a - b as an f64.

From your terminal

terminal
npm i -g https://liberas.dev/cli/liberas.tgz
export LIBERAS_URL=https://liberas.dev
liberas init calc-sub --lang rust
cd calc-sub && liberas build && liberas submit

Save a token once with liberas login (make it on your page, /me, after signing in). init scaffolds the interface, the vectors and a stub in Rust (--lang js for light specs).

Interface (WIT)11 lines›
calc-sub.wit
package root:component;

world root {
  export liberas:calc/operation@0.1.0;
}
package liberas:calc@0.1.0 {
  interface operation {
    apply: func(a: f64, b: f64) -> result<f64, string>;
  }
}
Verification5›
  • Outputs must match the private reference implementation bit for bit.
  • Cases are generated from the interface's types: edge values plus random ones seeded by your component's hash.
  • Components may import nothing but specs: no files, no network, no clock.
  • Runs on the user's machine: the component ships inside the product.
  • Unbuilt, the bounty rises 10% of its shares every 7 days, up to +100%.