0

I sometimes see this [0, 1) arrangement of square and round parentheses, but haven't been able to find anywhere that tells what it means. It isn't easily Googlable!

There is an example on this page https://www.tensorflow.org/api_docs/python/tf/random/uniform :

For floats, the default range is [0, 1)

Is it a programming construct? Something else?

Thanks.

Julian7
  • 191
  • 1
  • 12

2 Answers2

2

It is a mathematical notation for an "open range" or "half closed interval". The notation has no use in common programming languages, including Python. In this case, it means "all the representable numbers between 0 and 1, excluding 1".

Elazar
  • 20,415
  • 4
  • 46
  • 67
0

You'll find the answer right above where you found the source of your question:

The lower bound minval is included in the range, while the upper bound maxval is excluded.

vestland
  • 55,229
  • 37
  • 187
  • 305