Solved

counter limit

  • 11 January 2024
  • 4 replies
  • 7 views

Badge +1

Hi!

Do you know if Counter has a limit on the number that are generated (maximum lentgh)? I suppose there is not but I don't find this information anywhere.

Thank you!

icon

Best answer by david_r 11 January 2024, 17:42

View original

4 replies

Userlevel 5

It depends on the version of FME, it's either a signed 32-bit integer (verified with FME 2020, 64-bit) or a signed 64-bit integer (verified with FME 2023).

64-bit signed integers have a range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

32-bit signed integers have a range of -2,147,483,648 to 2,147,483,647.

Userlevel 5
Badge +36

Interesting! I never realized I could set negative numbers with the Counter transformer 😀

image

Userlevel 5

Interesting! I never realized I could set negative numbers with the Counter transformer 😀

image

Also be careful if you count past the positive upper limit, FME will silently wrap around to negative numbers and continue counting, without any warning.

Example from FME 2020 which uses a 32-bit counter:

imageThis is pretty much expected behavior for most integer implementations, but it might be something to look out for, at least on older FME versions if you expect to count past 2 billion.

Badge +1

@david_r​ Thank you for your answer !

Reply