- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 133 for Fact (0.03 sec)
-
test/typeparam/fact.go
package main import "fmt" func fact[T interface{ ~int | ~int64 | ~float64 }](n T) T { if n == 1 { return 1 } return n * fact(n-1) } func main() { const want = 120 if got := fact(5); got != want { panic(fmt.Sprintf("got %d, want %d", got, want)) } if got := fact[int64](5); got != want { panic(fmt.Sprintf("got %d, want %d", got, want)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 618 bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go
ImportPackageFact func(pkg *types.Package, fact Fact) bool // ExportObjectFact associates a fact of type *T with the obj, // replacing any previous fact of that type. // // ExportObjectFact panics if it is called after the pass is // complete, or if obj does not belong to the package being analyzed. // ExportObjectFact is not concurrency-safe. ExportObjectFact func(obj types.Object, fact Fact)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 04 16:19:04 UTC 2024 - 9.1K bytes - Viewed (0) -
test/peano.go
check(mul(gen(3), zero()), 0) check(mul(zero(), gen(4)), 0) check(mul(gen(3), add1(zero())), 3) check(mul(add1(zero()), gen(4)), 4) check(mul(gen(3), gen(4)), 12) check(fact(zero()), 1) check(fact(add1(zero())), 1) check(fact(gen(5)), 120) } // ------------------------------------- // Factorial var results = [...]int{ 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 30 19:39:18 UTC 2018 - 2.2K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go
// that the Doc is not empty; // that the Run is non-nil; // that the Requires graph is acyclic; // that analyzer fact types are unique; // that each fact type is a pointer. // // Analyzer names need not be unique, though this may be confusing. func Validate(analyzers []*Analyzer) error { // Map each fact type to its sole generating analyzer. factTypes := make(map[reflect.Type]*Analyzer)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Nov 20 21:52:54 UTC 2023 - 3.1K bytes - Viewed (0) -
test/typeparam/factimp.dir/main.go
package main import ( "./a" "fmt" ) func main() { const want = 120 if got := a.Fact(5); got != want { panic(fmt.Sprintf("got %d, want %d", got, want)) } if got := a.Fact[int64](5); got != want { panic(fmt.Sprintf("got %d, want %d", got, want)) } if got := a.Fact(5.0); got != want { panic(fmt.Sprintf("got %f, want %f", got, want)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 24 02:14:15 UTC 2022 - 516 bytes - Viewed (0) -
test/strength.go
package main import "fmt" func testMul(fact, bits int) string { n := fmt.Sprintf("testMul_%d_%d", fact, bits) fmt.Printf("func %s(s int%d) {\n", n, bits) want := 0 for i := 0; i < 200; i++ { fmt.Printf(` if want, got := int%d(%d), s*%d; want != got { failed = true fmt.Printf("got %d * %%d == %%d, wanted %d\n", s, got) } `, bits, want, i, i, want) want += fact } fmt.Printf("}\n")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Sep 08 17:28:20 UTC 2019 - 1K bytes - Viewed (0) -
maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
throws MisconfiguredToolchainException { List<ToolchainPrivate> toRet = new ArrayList<>(); ToolchainFactory fact = factories.get(type); if (fact == null) { logger.error("Missing toolchain factory for type: " + type + ". Possibly caused by misconfigured project."); } else { List<ToolchainModel> availableToolchains =
Registered: Wed Jun 12 09:55:16 UTC 2024 - Last Modified: Wed Sep 06 08:39:32 UTC 2023 - 3.1K bytes - Viewed (0) -
test/typeparam/factimp.dir/a.go
// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package a func Fact[T interface{ int | int64 | float64 }](n T) T { if n == 1 { return 1 } return n * Fact(n-1)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jul 28 21:40:40 UTC 2021 - 279 bytes - Viewed (0) -
analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/substitutorMarkers.kt
/** * A [KaSubstitutor] which substitution logic can be represented as a [Map] from a [KaTypeParameterSymbol] to corresponding [KaType] * This is an implementation details and Analysis API clients should not depend on the fact if some [KaSubstitutor] is [KaMapBackedSubstitutor] or not. */ @KaAnalysisApiInternals interface KaMapBackedSubstitutor : KaSubstitutor { /** * Substitution rules in a form of a `Map<KaTypeParameterSymbol, KaType>`
Registered: Wed Jun 12 09:53:16 UTC 2024 - Last Modified: Wed May 22 06:28:34 UTC 2024 - 1.4K bytes - Viewed (0) -
maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java
Registered: Wed Jun 12 09:55:16 UTC 2024 - Last Modified: Wed Sep 06 08:39:32 UTC 2023 - 4.6K bytes - Viewed (0)