mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
58565b42cc
This simplifies src/runtime/math.go, which I eventually want to remove entirely by moving the given functionality into the compiler.
15 lines
275 B
Go
15 lines
275 B
Go
package main
|
|
|
|
// Test how intrinsics are lowered: either as regular calls to the math
|
|
// functions or as LLVM builtins (such as llvm.sqrt.f64).
|
|
|
|
import "math"
|
|
|
|
func mySqrt(x float64) float64 {
|
|
return math.Sqrt(x)
|
|
}
|
|
|
|
func myTrunc(x float64) float64 {
|
|
return math.Trunc(x)
|
|
}
|