当前位置: 首页>>代码示例>>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;未经允许,请勿转载。