composite definitions: casting to float?
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Oct 2011
    Posts
    36

    Default composite definitions: casting to float?

    Hi,

    In a composite definition I have the following expression:

    HEM."EP 4Bet vs blinds"/HEM."EP 4Bet vs ip"

    I believe this is currently using an integer division, and I would like it to be a float to increase precision (since I expect this ratio to normally be between 0 and 3)

    Here is some background on what I'm trying to accomplish: I'm building a new HUD with as many advanced features I can think of Currently I have the idea of showing a 'warning' badge at a specific location in the HUD if certain criteria are met. In this case, if the ratio I'm calculating is too far away from 1, then the 4bet range I'm putting my opponent on might be way off depending on my position, so I want to place a warning badge (exclamation mark or something) directly behind the stat. (I believe this part is possible by using a prefix badge)

  2. #2
    NoteCaddy sreticentv's Avatar
    Join Date
    Dec 2009
    Location
    No direction but to trust the final destination
    Posts
    6,481

    Default

    It uses decimal division. You can test this by making a constant expression:
    (2 / 3) * 100
    and watch how the result is 66 for everyone wherein it would be 0 if they were computed as 0s

    I also verified that HEM returns their stats as decimals

  3. #3
    Member
    Join Date
    Oct 2011
    Posts
    36

    Default

    aha ok, so the expression is doing it's job correctly. Then rounding seems to be off in the HUD (as a stat in the HUD, haven't testing in popups).

    If I have the expression 9/5 I expect the hud to show '2' if I have 0 decimals and '1.8' if I have 1 decimal enabled in the HUD. Instead it shown '1' and 1.0' so I expect somewhere after the expession is evaluated the number is still being cast to an integer.

Similar Threads

  1. Composite Definition and Partitions
    By Mr. Peek in forum NoteCaddy
    Replies: 7
    Last Post: 12-04-2012, 05:41 PM
  2. Composite Definition HM stats question
    By melles in forum NoteCaddy
    Replies: 2
    Last Post: 07-18-2012, 01:19 PM
  3. Composite Definition Q
    By bluetail in forum NoteCaddy
    Replies: 2
    Last Post: 07-11-2012, 05:48 AM
  4. HEM Cold Call Stats in Composite Definition
    By AlexTur in forum NoteCaddy
    Replies: 3
    Last Post: 06-21-2012, 06:54 PM
  5. Replies: 3
    Last Post: 06-15-2012, 08:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •