multipleconversions

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: 3 Imported by: 0

Documentation

Overview

Package multipleconversions implements postfix calculator using conversions.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func RPN

func RPN(RPNInput string) float64

RPN returns the result of an expression using reverse polish notation (postfix) by exploding the string to a slice and editing the slice by replacing each op by its result until only a number is left or failing if the expression is invalid.

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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