lfs

package
v0.0.0-...-737f475 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

lfs stands for Lib Functions Steph

lfs stands for Lib Functions Steph

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFactorial

func GetFactorial(input int) int

GetFactorial returns the factorials of a number. It returns 0 when 0 or smaller.

func Getdivisors

func Getdivisors(i int) []int

* Getdivisors tries like in the linked example to divide all numbers under the squareroot. Each result is also a divisor. We have to check if it's the same though: 100 / 10 = 10. The second half works backwards: 100/1 = 100, 100/2 = 50 So we store those apart and in the end return those reversed. https://www.geeksforgeeks.org/find-all-divisors-of-a-natural-number-set-2/ *

func Gettrianglenumber

func Gettrianglenumber(n int) int

Gettrianglenumber gets the n'th triangle number. The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28

func PanErr

func PanErr(err error)

PanErr panics with an error, or does nothing

func ReadLines

func ReadLines(path string) ([]string, error)

readLines reads a whole file into memory and returns a slice of its lines.

func SilentAtoi

func SilentAtoi(input string) int

SilentAtoi returns an int or panics

Types

This section is empty.

Jump to

Keyboard shortcuts

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