aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_i64_cmp2.in
blob: 8985e5a86ec61ce107d3dbae9bdac15db6bc91d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <inttypes.h>
#include <stdio.h>

typedef int32_t INT32;
typedef int64_t INT64;
typedef uint8_t UINT8;

void interface_clock_changed() {
  UINT8 m_divshift;
  INT32 m_divisor;

  // INT64 attos = m_attoseconds_per_cycle;
  INT64 attos = 279365114840;
  m_divshift = 0;
  while (attos >= (1UL << 31)) {
    m_divshift++;
    printf("m_divshift is %i, on %Ld >?= %lu\n", m_divshift, attos, 1UL << 31);
    attos >>= 1;
  }
  m_divisor = attos;

  printf("m_divisor is %i\n", m_divisor);
}

int main() {
  interface_clock_changed();
  return 0;
}