Double vs Int

Forum Home Forums Understanding the Software Double vs Int

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12026
    victorlam
    Participant

    Hello,

    Please help to advise on the clarification between int and double especially using formula

    For example

    public int Myfunc()
    xxxx

    public double Myfunc()
    xxx

    Can anyone share the difference when the formula is set?
    According to my understanding, int refers to the integer number 1, 2, … and double means the floating number. Do you need to click the correct type within Administrator? If the original value is integer, then I have a calculation of divided by 10 and become 1.5. How can we handle this? Or it still consider as int.

    #12030
    Mikhail
    Moderator

    Hello,

    The default data type for channels is double. This data type allows to store either integers or floats. Channel formulas should return double because channels are stored as doubles.
    I recommend, not to use channel data type in the Channels table if you don’t have significant reasons to do that. Channel data type must match a tag data type provided by a device driver, which is double in most cases.

    #12037
    victorlam
    Participant

    Hello,
    Do you mean to leave all channel data type blank in the box?

    #12045
    Mikhail
    Moderator

    Hello,

    In most cases, the Data Type field of in the Channels table should be blank that is the same as Double.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.