Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for isInt (0.37 sec)

  1. src/text/template/parse/node.go

    			n.Float64 = f
    			// If a floating-point extraction succeeded, extract the int if needed.
    			if !n.IsInt && float64(int64(f)) == f {
    				n.IsInt = true
    				n.Int64 = int64(f)
    			}
    			if !n.IsUint && float64(uint64(f)) == f {
    				n.IsUint = true
    				n.Uint64 = uint64(f)
    			}
    		}
    	}
    	if !n.IsInt && !n.IsUint && !n.IsFloat {
    		return nil, fmt.Errorf("illegal number syntax: %q", text)
    	}
    	return n, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:57:51 UTC 2024
    - 24.2K bytes
    - Viewed (0)
  2. src/math/big/rat_test.go

    	}
    }
    
    func TestIsInt(t *testing.T) {
    	one := NewInt(1)
    	for _, a := range setStringTests {
    		x, ok := new(Rat).SetString(a.in)
    		if !ok {
    			continue
    		}
    		i := x.IsInt()
    		e := x.Denom().Cmp(one) == 0
    		if i != e {
    			t.Errorf("got IsInt(%v) == %v; want %v", x, i, e)
    		}
    	}
    }
    
    func TestRatAbs(t *testing.T) {
    	zero := new(Rat)
    	for _, a := range setStringTests {
    		x, ok := new(Rat).SetString(a.in)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 07 00:15:59 UTC 2022
    - 18.9K bytes
    - Viewed (0)
  3. analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtTypeInfoProvider.kt

        public val KaType.isUnit: Boolean get() = withValidityAssertion { isClassTypeWithClassId(DefaultTypeClassIds.UNIT) }
        public val KaType.isInt: Boolean get() = withValidityAssertion { isClassTypeWithClassId(DefaultTypeClassIds.INT) }
        public val KaType.isLong: Boolean get() = withValidityAssertion { isClassTypeWithClassId(DefaultTypeClassIds.LONG) }
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Tue Jun 04 08:26:19 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  4. src/text/template/parse/parse_test.go

    			t.Errorf("complex incorrect for %q; should be %t", test.text, test.isComplex)
    		}
    		if test.isInt {
    			if !n.IsInt {
    				t.Errorf("expected integer for %q", test.text)
    			}
    			if n.Int64 != test.int64 {
    				t.Errorf("int64 for %q should be %d Is %d", test.text, test.int64, n.Int64)
    			}
    		} else if n.IsInt {
    			t.Errorf("did not expect integer for %q", test.text)
    		}
    		if test.isUint {
    			if !n.IsUint {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 24 21:59:12 UTC 2024
    - 24K bytes
    - Viewed (0)
  5. src/fmt/print.go

    	default:
    		p.unknownType(f)
    	}
    }
    
    // intFromArg gets the argNumth element of a. On return, isInt reports whether the argument has integer type.
    func intFromArg(a []any, argNum int) (num int, isInt bool, newArgNum int) {
    	newArgNum = argNum
    	if argNum < len(a) {
    		num, isInt = a[argNum].(int) // Almost always OK.
    		if !isInt {
    			// Work harder.
    			switch v := reflect.ValueOf(a[argNum]); v.Kind() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:22:43 UTC 2024
    - 31.8K bytes
    - Viewed (0)
  6. analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/evaluate/FirAnnotationValueConverter.kt

                type.isUShort -> KaConstantValue.KaUnsignedShortConstantValue((value as Number).toShort().toUShort(), expression)
                type.isInt -> KaConstantValue.KaIntConstantValue((value as Number).toInt(), expression)
                type.isUInt -> KaConstantValue.KaUnsignedIntConstantValue((value as Number).toInt().toUInt(), expression)
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Tue Jun 11 15:45:42 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/cel/value.go

    }
    
    // Get returns the value at the given index.
    //
    // If the index is negative or greater than the size of the list, an error is returned.
    func (lv *ListValue) Get(idx ref.Val) ref.Val {
    	iv, isInt := idx.(types.Int)
    	if !isInt {
    		return types.ValOrErr(idx, "unsupported index: %v", idx)
    	}
    	i := int(iv)
    	if i < 0 || i >= len(lv.Entries) {
    		return types.NewErr("index out of bounds: %v", idx)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 10 22:05:55 UTC 2022
    - 20.5K bytes
    - Viewed (0)
  8. src/math/big/ratconv.go

    func (x *Rat) RatString() string {
    	if x.IsInt() {
    		return x.a.String()
    	}
    	return x.String()
    }
    
    // FloatString returns a string representation of x in decimal form with prec
    // digits of precision after the radix point. The last digit is rounded to
    // nearest, with halves rounded away from zero.
    func (x *Rat) FloatString(prec int) string {
    	var buf []byte
    
    	if x.IsInt() {
    		buf = x.a.Append(buf, 10)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 15 22:16:34 UTC 2023
    - 12.3K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/flatbuffer_operator.cc

        } else if (value.IsString()) {
          mlir_vector.push_back(
              BuildVhloStringV1Attr(value.AsString().str(), builder));
        } else if (value.IsInt()) {
          mlir_vector.push_back(BuildVhloIntV1Attr(value.AsInt64(), builder));
        } else if (value.IsFloat()) {
          mlir_vector.push_back(BuildVhloFloatV1Attr(value.AsFloat(), builder));
        } else if (value.IsVector()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 21 18:21:50 UTC 2024
    - 38K bytes
    - Viewed (0)
  10. src/math/big/rat.go

    	return z
    }
    
    // Sign returns:
    //
    //	-1 if x <  0
    //	 0 if x == 0
    //	+1 if x >  0
    func (x *Rat) Sign() int {
    	return x.a.Sign()
    }
    
    // IsInt reports whether the denominator of x is 1.
    func (x *Rat) IsInt() bool {
    	return len(x.b.abs) == 0 || x.b.abs.cmp(natOne) == 0
    }
    
    // Num returns the numerator of x; it may be <= 0.
    // The result is a reference to x's numerator; it
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 13.5K bytes
    - Viewed (0)
Back to top