<commit_before>// Package math contains wdte.Funcs for performing mathematical
// operations.
package math

import (
	"math"

	"github.com/DeedleFake/wdte"
)

// Pi ignores its arguments and returns π as a wdte.Number.
func Pi(frame []wdte.Func, args ...wdte.Func) wdte.Func {
	return wdte.Number(math.Pi)
}

// Sin returns sin(args[0]).
func Sin(frame []wdte.Func, args ...wdte.Func) wdte.Func {
	if len(args) == 0 {
		return wdte.GoFunc(Sin)
	}

	a := args[0].Call(frame).(wdte.Number)
	return wdte.Number(math.Sin(a))
}

// Cos returns cos(args[0]).
func Cos(frame []wdte.Func, args ...wdte.Func) wdte.Func {
	if len(args) == 0 {
		return wdte.GoFunc(Cos)
	}

	a := args[0].Call(frame).(wdte.Number)
	return wdte.Number(math.Cos(a))
}

// Tan returns tan(args[0]).
func Tan(frame []wdte.Func, args ...wdte.Func) wdte.Func {
	if len(args) == 0 {
		return wdte.GoFunc(Tan)
	}

	a := args[0].Call(frame).(wdte.Number)
	return wdte.Number(math.Tan(a))
}

// Import returns a module that contains the functions in this
// package. This can be used by an Importer to import them more
// easily. The functions in the returned module have the same names as
// those in this package except that they are lowercase.
func Import() *wdte.Module {
	return &wdte.Module{
		Funcs: map[wdte.ID]wdte.Func{
			"pi": wdte.GoFunc(Pi),<commit_msg>std/math: Fix compilation errors.<commit_after>// Package math contains wdte.Funcs for performing mathematical
// operations.
package math

import (
	"math"

	"github.com/DeedleFake/wdte"
)

// Pi ignores its arguments and returns π as a wdte.Number.
func Pi(frame []wdte.Func, args ...wdte.Func) wdte.Func {
	return wdte.Number(math.Pi)
}

// Sin returns sin(args[0]).
func Sin(frame []wdte.Func, args ...wdte.Func) wdte.Func {
	if len(args) == 0 {
		return wdte.GoFunc(Sin)
	}

	a := args[0].Call(frame).(wdte.Number)
	return wdte.Number(math.Sin(float64(a)))
}

// Cos returns cos(args[0]).
func Cos(frame []wdte.Func, args ...wdte.Func) wdte.Func {
	if len(args) == 0 {
		return wdte.GoFunc(Cos)
	}

	a := args[0].Call(frame).(wdte.Number)
	return wdte.Number(math.Cos(float64(a)))
}

// Tan returns tan(args[0]).
func Tan(frame []wdte.Func, args ...wdte.Func) wdte.Func {
	if len(args) == 0 {
		return wdte.GoFunc(Tan)
	}

	a := args[0].Call(frame).(wdte.Number)
	return wdte.Number(math.Tan(float64(a)))
}

// Import returns a module that contains the functions in this
// package. This can be used by an Importer to import them more
// easily. The functions in the returned module have the same names as
// those in this package except that they are lowercase.
func Import() *wdte.Module {
	return &wdte.Module{
		Funcs: map[wdte.ID]wdte.Func{
			"pi": wdte.GoFunc(Pi),
{'fraction_non_alphanumeric': 0.1578558225508318, 'fraction_numerical': 0.0088724584103512, 'mean_word_length': 3.649484536082474, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '717599', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1021, 'n_words': 278}