Created
September 15, 2020 21:19
-
-
Save crgimenes/5f6b68bcfe0a7305fad41277c4711e62 to your computer and use it in GitHub Desktop.
Simple function example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package exemple | |
func MapIntervalFloat64(value, fromLow, fromHigh, toLow, toHigh float64) (ret float64) { | |
ret = (value-fromLow)*(toHigh-toLow)/(fromHigh-fromLow) + toLow | |
return | |
} | |
func SimpleMapIntervalFloat64(value, fromHigh, toHigh float64) (ret float64) { | |
ret = value * toHigh / fromHigh | |
return | |
} | |
func Factorial(value uint) uint { | |
if value == 0 { | |
return 1 | |
} | |
return value * Factorial(value-1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment