當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript long.fromInt函數代碼示例

本文整理匯總了TypeScript中long.fromInt函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript fromInt函數的具體用法?TypeScript fromInt怎麽用?TypeScript fromInt使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了fromInt函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it("should correctly dispatch receiveMetrics with an unmatching nextRequest", function() {
   let response = new protos.cockroach.ts.tspb.TimeSeriesQueryResponse({
     results: [
       {
         datapoints: [],
       },
     ],
   });
   let request = new protos.cockroach.ts.tspb.TimeSeriesQueryRequest({
     start_nanos: Long.fromInt(0),
     end_nanos: Long.fromInt(10),
     queries: [
       {
         name: "test.metric.1",
       },
     ],
   });
   state = reducer(state, metrics.receiveMetrics(componentID, request, response));
   assert.isDefined(state.queries);
   assert.isDefined(state.queries[componentID]);
   assert.lengthOf(_.keys(state.queries), 1);
   assert.equal(state.queries[componentID].data, null);
   assert.equal(state.queries[componentID].request, null);
   assert.isUndefined(state.queries[componentID].nextRequest);
   assert.isUndefined(state.queries[componentID].error);
 });
開發者ID:martinpinto,項目名稱:cockroach,代碼行數:26,代碼來源:metrics.spec.ts

示例2: IsLeader

export function IsLeader(info: protos.cockroach.server.serverpb.RangeInfo$Properties) {
  const localRep = GetLocalReplica(info);
  if (_.isNil(localRep)) {
    return false;
  }
  return Long.fromInt(localRep.replica_id).eq(FixLong(info.raft_state.lead));
}
開發者ID:boreys,項目名稱:cockroach,代碼行數:7,代碼來源:rangeInfo.ts

示例3: FixLong

export function FixLong(value: Long | number): Long {
  if (value as any === 0) {
    return Long.fromInt(0);
  }
  return value as Long;
}
開發者ID:asubiotto,項目名稱:cockroach,代碼行數:6,代碼來源:fixLong.ts

示例4: it

 it("100500 ^ 100500 mod 14 == 8", () => {
     expect(modularPow(Long.fromInt(100500), 100500, 14)).toEqual(8);
 });
開發者ID:bacher09,項目名稱:pwgen-for-bios,代碼行數:3,代碼來源:sony_4x4.spec.ts

示例5:

const mapper: OperationMapper = OperationMapper.Instance;
let graph: Graph;
const SIMPLE_MODEL: tensorflow.IGraphDef = {
  node: [
    {
      name: 'image_placeholder',
      op: 'Placeholder',
      attr: {
        dtype: {
          type: tensorflow.DataType.DT_FLOAT,
        },
        shape: {
          shape: {
            dim: [
              {size: Long.fromInt(3)}, {size: Long.fromInt(3)},
              {size: Long.fromInt(3)}, {size: Long.fromInt(1)}
            ]
          }
        }
      }
    },
    {
      name: 'Const',
      op: 'Const',
      attr: {
        dtype: {type: tensorflow.DataType.DT_INT32},
        value: {
          tensor: {
            dtype: tensorflow.DataType.DT_INT32,
            tensorShape: {dim: [{size: 3}, {size: 3}, {size: 1}, {size: 1}]},
開發者ID:oveddan,項目名稱:tfjs-converter,代碼行數:30,代碼來源:operation_mapper_test.ts


注:本文中的long.fromInt函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。