Revision history [back]
click to hide/show revision 1
initial version

posted Mar 03 '10 at 13:31

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I don't know how Varian labels data formats - it's interesting if there are indeed two options. With `C` programming language there seem to be two ways to figure out whether data is is int the floating point format or integer using: * using `modf()` and `modff()` functions (type `man modf` on your console) * trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always `0` - you have integer format, otherwise it's float.
click to hide/show revision 2
No.1 Revision

posted Mar 03 '10 at 13:32

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I don't know how Varian labels data formats - it's interesting if there are indeed two options.options. Floating point option offers greater "dynamic range" of storable numbers.

With C programming language there seem to be two ways to figure out whether data is is int the floating point format or integer using:

  • using modf() and modff() functions (type man modf on your console)
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.
click to hide/show revision 3
No.2 Revision

posted Mar 03 '10 at 13:40

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I don't know how Varian labels data formats - it's interesting if there are indeed two options. Floating point option offers greater "dynamic range" of storable numbers.

With C programming language there seem to be two ways to figure out whether data is is int the floating point format or integer using:

  • using modf() and modff() functions (type man modf on your console)
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

click to hide/show revision 4
No.3 Revision

posted Mar 03 '10 at 13:41

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I don't know how Varian labels data formats - it's interesting if there are indeed two options. Floating point option offers greater "dynamic range" of storable numbers.

With C programming language there seem to be two ways to figure out guess whether data is is int in the integer or floating point format or integer using: format:

  • using modf() and modff() functions (type man modf on your console)console) to extract integer and decimal parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

click to hide/show revision 5
No.4 Revision

posted Mar 03 '10 at 13:52

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I don't know how didn't that Varian labels data formats - it's interesting if there are indeed two options. has that numeric mode bit. Floating point option offers greater "dynamic range" of storable numbers.

With C programming language there seem to be two ways to guess whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and decimal parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

click to hide/show revision 6
No.5 Revision

posted Mar 03 '10 at 13:52

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I didn't know that Varian has that numeric mode bit. bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.

With C programming language there seem to be two ways to guess whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and decimal parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

click to hide/show revision 7
No.6 Revision

posted Mar 04 '10 at 12:04

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I didn't know that Varian has that numeric mode bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.

With C programming language there seem to be two ways to guess whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and decimal parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

edit: turns out this method may not be reliable - pls see comments under the Kirk's answer.

click to hide/show revision 8
No.7 Revision

posted Mar 04 '10 at 12:10

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I didn't know that Varian has that numeric mode bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.

With C programming language there seem to be two ways to guess whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and decimal parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

edit: turns out hmm, interesting (pls see comments under Kirk's answer) this method may not be reliable unreliable or even just wrong. If any integer in a binary representation is a valid float, then there is no guarantee that there won't be some non-zero fractional portion of the casted number. Lemme think about it - pls see comments under the Kirk's maybe I should retract this answer.

click to hide/show revision 9
No.8 Revision

posted Mar 04 '10 at 12:11

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I didn't know that Varian has that numeric mode bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.

With C programming language there seem to be two ways to guess whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and decimal parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

edit: hmm, interesting (pls see comments under Kirk's answer) this method may be unreliable or even just wrong. If any integer in a binary representation is a valid float, then there is no guarantee that there won't be some non-zero fractional portion of the integer casted number. into float. Lemme think about it - maybe I should retract this answer.it.

click to hide/show revision 10
No.9 Revision

posted Mar 04 '10 at 12:14

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I didn't know that Varian has that numeric mode bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.

With C programming language there seem to be two ways to guess whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and decimal fractional parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

edit: hmm, interesting (pls see comments under Kirk's answer) this method may be unreliable or even just wrong. If any integer in a binary representation is a valid float, then there is no guarantee that there won't be some non-zero fractional portion of integer casted into float. Lemme think about it.

click to hide/show revision 11
No.10 Revision

posted Mar 04 '10 at 12:36

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I didn't know that Varian has that numeric mode bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.

edit: Kirk is right - there is no way to guess whether a one given number is float or integer, since in the end both are represented by a bunch of bits, however there may be a way to analyze a pattern within a set of numbers casted as integers and casted as floats. It does seem to be more complicated than I thought, anyway - below is the answer I've given originally:

With C programming language there seem to be two ways to guess (actually wrong - it's not a way to guess, but merely a way to extract a fractional and an integer part of a float) whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and fractional parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

edit: hmm, interesting (pls see comments under Kirk's answer) this method may be unreliable or even just wrong. If any integer in a binary representation is a valid float, then there is no guarantee that there won't be some non-zero fractional portion of integer casted into float. Lemme think about it.

click to hide/show revision 12
No.11 Revision

posted Mar 04 '10 at 12:36

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I didn't know that Varian has that numeric mode bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.

edit: Kirk is right - there is probably no way to guess whether a one given number is float or integer, since in the end both are represented by a bunch of bits, however there may be a way to analyze a pattern within a set of numbers casted as integers and casted as floats. It does seem to be more complicated than I thought, anyway - below is the answer I've given originally:

With C programming language there seem to be two ways to guess (actually wrong - it's not a way to guess, but merely a way to extract a fractional and an integer part of a float) whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and fractional parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

click to hide/show revision 13
No.12 Revision

posted Mar 04 '10 at 12:42

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I didn't know that Varian has that numeric mode bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.

edit: Kirk is right - there is probably no way to guess whether a one given number is float or integer, since in the end both are represented by a bunch of bits, however there may be a way to analyze a pattern within a set of numbers casted as integers and casted as floats. It's kind of like guessing in which language some text is written by looking at a sample. It does seem to be more complicated than I thought, anyway - below is the answer I've given originally:

With C programming language there seem to be two ways to guess (actually wrong - it's not a way to guess, but merely a way to extract a fractional and an integer part of a float) whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and fractional parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

click to hide/show revision 14
No.13 Revision

posted Mar 04 '10 at 12:43

Evgeny%20Fadeev's gravatar image

Evgeny Fadeev
5771

Hello, I didn't know that Varian has that numeric mode bit, thanks for bringing it up. Floating point option offers greater "dynamic range" of storable numbers.

edit: Kirk is right - there is probably no way to guess whether a one given number is float or integer, since in the end both are represented by a bunch of bits, bits (here is a Wikipedia page about Floating Point representation), however there may be a way to analyze a pattern within a set of numbers casted as integers and casted as floats. It's kind of like guessing in which language some text is written by looking at a sample. It does seem to be more complicated than I thought, anyway - below is the answer I've given originally:

With C programming language there seem to be two ways to guess (actually wrong - it's not a way to guess, but merely a way to extract a fractional and an integer part of a float) whether data is in the integer or floating point format:

  • using modf() and modff() functions (type man modf on your console) to extract integer and fractional parts
  • trying to cast a value into float first, then recast it into integer and calculate the difference. If the difference is always 0 - you have integer format, otherwise it's float.

Take a look here for more details.

So you could run through all the numbers with one of the methods and determine the format of entire set.

powered by CNPROG