stack

package
v0.0.0-...-40e32b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2022 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package stack implements postfix calculator using a stack package.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func RPNStack

func RPNStack(input string) float64

RPNStack prints the result of a string in reverse polish notation (postfix) using stack package of golang-collections.

Example

Running exemples where fmt is needed to check output.

fmt.Printf("%.13f", RPNStack(values.Input))
Output:
3.0001220703125
Example (Sqrt)
fmt.Printf("%f", RPNStack(values.RPNInput))
Output:
30.000000

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL