Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Long variables?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Long variables?

    Following up on this previous thread:



    How large of a number can actually be put to an int local variable? If I plan on using values such as 46.72400779, would I be better suited using int datatypes, double datatypes or long datatypes? What are the limits of each?

    Thank you in advance,
    Gary

    #2
    Hello,

    Thank you for the question.

    Based on the number this could not be a int, an int can only be a whole number with no decimal place and inbetween the range of -2,147,483,648 and 2,147,483,647.

    For that number you could use a double precision number or just double

    Generally you will only use int or double in a NinjaScript file, I have rarely seen long needed to be used.

    You can find all of their minimum and maximum values by searching google would be the fastest way. The MSDN documentation is generally the first result for what you are looking for regarding c#.

    For the int min / max you could search C# int minimum and it results in this MSDN article: https://msdn.microsoft.com/en-us/lib...vs.110%29.aspx

    This is also a excellent resource starting at section 5 and beyond, this covers most of the core C# concepts and syntax so I always recommend this as well: http://www.techotopia.com/index.php/C_Sharp_Essentials

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      That's what I was looking for, thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by WHICKED, Today, 12:45 PM
      2 responses
      19 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by GussJ, 03-04-2020, 03:11 PM
      15 responses
      3,276 views
      0 likes
      Last Post xiinteractive  
      Started by Tim-c, Today, 02:10 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      5 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      51 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Working...
      X